Closed mbeckem closed 9 months ago
Related: https://github.com/vitejs/vite-plugin-react-swc/discussions/138
I think the problem is to be solved at the core level. I need to investigate but I might push it in the next major coming in September.
The reason I used 2020
is to avoid having your dev env working in one browser but not another just because you use a new syntax. If the problem is not solved in core, I will bump it in this package to what Safari 15 as implemented at this time.
In the meantime I think using a one line patch is the best solution (using pnpm or patch-package)
It's enabled on TS to allow to disable esbuild completely, otherwise esbuild will run on SWC output for TSX. It's also expected for people using plugins.
Thank you for the explanation. A patch via pnpm is exactly what we're doing in the meantime.
Hi,
during developement this plugin currently applies
target: "es2020"
to swc's JscTarget with no way to change the language level.In our case this results in JavaScript's private fields being transpiled into
WeakMap
s, even though all major browser support this feature by now (this makes debugging classes using private fields very unpleasant).It would help a lot if the plugin would support a
target
option, e.g.Alternatively, the default target could simply be raised.
Just out of curiosity, why does the plugin's transform hook run on "plain"
.ts
files (no JSX)?Thanks!