Closed b3nten closed 5 days ago
I've look into it and the support from SWC is not quite there (it can be added by using https://swc.rs/docs/configuration/compilation#jsctransformdecoratorversion), but it not as stable in SWC as in esbuild. I've updated the description of https://github.com/vitejs/vite-plugin-react-swc/issues/86 to reflect this and I'm closing this as duplicate.
For now you can either patch to opt-in to unstable 2022-03 or use the legacy one (both as declared supported by mobx) using tsDecorators
option (requires using TS/TSX source code)
While Vite 5.3 updated esbuild to support stage 3 decorators, and SWC has supported it for a while, when I enable the react plugin it throws the following error (using mobx):
When I disable the plugin it works fine, but of course I don't have react refresh anymore. Here is my vite config: