From afa0f0bcf478739ba269e2ceafb7ca832c6e4a4b Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 4 Nov 2024 01:58:51 +0300 Subject: [PATCH] Vite es-decorators configuration example --- docs/enabling-decorators.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/enabling-decorators.md b/docs/enabling-decorators.md index aaa2ad976..8e14b78ac 100644 --- a/docs/enabling-decorators.md +++ b/docs/enabling-decorators.md @@ -39,6 +39,28 @@ With modern decorators, it is no longer needed to call `makeObservable` / `makeA } ``` +- Vite configuration + +```js +// vite.config.js +{ + plugins: [ + react({ + babel: { + plugins: [ + [ + "@babel/plugin-proposal-decorators", + { + version: "2023-05", + }, + ], + ], + }, + }), + ] +} +``` + ## Using decorators ```javascript