Skip to content

Commit c04c24a

Browse files
authored
docs: Vite es-decorators configuration example (#3955)
1 parent bca3841 commit c04c24a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/enabling-decorators.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,28 @@ With modern decorators, it is no longer needed to call `makeObservable` / `makeA
3939
}
4040
```
4141

42+
- Vite configuration
43+
44+
```js
45+
// vite.config.js
46+
{
47+
plugins: [
48+
react({
49+
babel: {
50+
plugins: [
51+
[
52+
"@babel/plugin-proposal-decorators",
53+
{
54+
version: "2023-05",
55+
},
56+
],
57+
],
58+
},
59+
}),
60+
]
61+
}
62+
```
63+
4264
## Using decorators
4365

4466
```javascript

0 commit comments

Comments
 (0)