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

feat!: allow to run Babel on non js/ts extensions #122

Merged
merged 3 commits into from
Apr 1, 2023
Merged

feat!: allow to run Babel on non js/ts extensions #122

merged 3 commits into from
Apr 1, 2023

Conversation

ArnaudBarre
Copy link
Member

@ArnaudBarre ArnaudBarre commented Mar 26, 2023

API changes:

  • Make include/exclude work like other plugins. This allows to make it work with mdx plugin. Also I think that all the query params thing was to workaround this limitation (and probably also inspire by how Vue SFC works) and I don't think it makes sense for the React plugin now that you can explicitly include more extensions.
  • Don't change the behaviour when the import is outside of Vite root. This is blocking a lot of monorepo setup.
  • Don't process node_modules files. TS in node_modules is still supported thanks to esbuild. It would be really strange to require a custom babel transform to load a node_modules file.
  • Drop fastRefresh: I don't see any reason for this flag. This is 80% of the goal of this plugin now that esbuild handles all jsx transformation. If there are other cases where it needs to be disabled (like ssr, prod currently), this should be detected by the plugin.

@ArnaudBarre
Copy link
Member Author

I think in the next PR I will remove the "pre" for the transform part (but keep it for the resolve refresh runtime). WDY @patak-dev?

packages/plugin-react/src/index.ts Outdated Show resolved Hide resolved
packages/plugin-react/README.md Outdated Show resolved Hide resolved
packages/plugin-react/src/index.ts Show resolved Hide resolved
packages/plugin-react/src/index.ts Show resolved Hide resolved
packages/plugin-react/src/index.ts Outdated Show resolved Hide resolved
@ArnaudBarre ArnaudBarre merged commit 5d8a052 into main Apr 1, 2023
@ArnaudBarre ArnaudBarre deleted the next branch April 1, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants