Description
vite & react generators that allow choosing a compiler/transpiler.
choosing between babel and swc. when choosing babel the react plugin will be the default @vitejs/plugin-react
but when choosing swc, the react plugin will be imported from @vitejs/plugin-react-swc
Motivation
two main reasons:
- swc is faster and we want our app to go brrrr
- when choosing swc currently as the compiler when generating a react app, together with the vite bundler option, it adds both vite and swc-loader to the packages json even though we aren't using webpack. this elongates our
npm i times for nothing.
Suggested Implementation
adding a compiler option to the @nx/vite generator schema and changing the reactPluginImportLine from the generator-utils .ts file according to the user's input.
Description
vite & react generators that allow choosing a compiler/transpiler.
choosing between babel and swc. when choosing babel the react plugin will be the default
@vitejs/plugin-reactbut when choosing swc, the react plugin will be imported from
@vitejs/plugin-react-swcMotivation
two main reasons:
npm itimes for nothing.Suggested Implementation
adding a compiler option to the
@nx/vitegenerator schema and changing thereactPluginImportLinefrom the generator-utils .ts file according to the user's input.