Closed as not planned
Description
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):
[plugin:vite:react-swc] × Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key @observable
When I disable the plugin it works fine, but of course I don't have react refresh anymore. Here is my vite config:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
tailwindcss(),
react({
devTarget: "es2022",
})
],
css: {
transformer: "lightningcss"
},
esbuild: {
target: "es2022"
}
})```
Metadata
Metadata
Assignees
Labels
No labels