-
-
Notifications
You must be signed in to change notification settings - Fork 213
Description
Description
For performance reasons, I would like to not use Babel at all but let esbuild handle everything while still having support for fast refresh. By looking at the code it seems like fast refresh is the only reason that babel is invoked by default.
As a side effect, this would avoid problems like the one mentioned in #266
Suggested solution
If I understand correctly, vite-plugin-react-swc has a pure JS implementation of react refresh. By integrating that into this repository, the babel plugin react-refresh/babel becomes unnecessary and babel can be skipped by default. Maybe there is a reason this cannot be done though?
Alternative
Using plugin-react-swc would be an alternative but has other drawbacks for existing (aka old aka legacy) projects, such as the requirement to have useDefineForClassFields: true and that writing custom plugins in Rust cumbersome to many compared to a few lines of JS
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.