Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding swc compilter option to the @nx/react generator using vite #17039

Closed
1 task done
amitgk1 opened this issue May 15, 2023 · 1 comment · Fixed by #17224
Closed
1 task done

Adding swc compilter option to the @nx/react generator using vite #17039

amitgk1 opened this issue May 15, 2023 · 1 comment · Fixed by #17224
Assignees
Labels
outdated scope: react Issues related to React support for Nx type: feature

Comments

@amitgk1
Copy link

amitgk1 commented May 15, 2023

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:

  1. swc is faster and we want our app to go brrrr
  2. 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.

@AgentEnder AgentEnder added the scope: react Issues related to React support for Nx label May 15, 2023
@xiongemi xiongemi self-assigned this May 23, 2023
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react Issues related to React support for Nx type: feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants