@vitejs/plugin-react-swc
Advanced tools
Changelog
3.8.0
The future of Vite is with OXC, and from the beginning this was a design choice to not exposed too many specialties from SWC so that Vite React users can move to another transformer later.
Also debugging why some specific version of decorators with some other unstable/legacy feature doesn't work is not fun, so we won't provide support for it, hence the name useAtYourOwnRisk
.
react({
useAtYourOwnRisk_mutateSwcOptions(options) {
options.jsc.parser.decorators = true;
options.jsc.transform.decoratorVersion = "2022-03";
},
});
Changelog
3.7.0
This is a long overdue and should fix some issues people had with HMR when migrating from CRA.
Changelog
3.6.0
This will unlock to use the plugin in some use cases where the original source code is not in TS. Using this option to keep using JSX inside .js
files is highly discouraged and can be removed in any future version.
Changelog
3.5.0
There were no breaking change that impacted this plugin, so any combination of React plugins and Vite core version will work.
This will only affect people using internal libraries that contains untranspiled JSX. This change aligns the optimizer with the source code and avoid issues when the published source don't have React
in the scope.
Reminder: While being partially supported in Vite, publishing TS & JSX outside of internal libraries is highly discouraged.