-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Kill CJS #5839
Comments
@patak-js
This ticket solves that problem. |
You can put a ✅ on Nuxt3. All packages are in ESM only format since nuxt/framework#539. BTW we have to keep supporting cjs deps for time being until ecosystem is more prepared (notably Jest, Typescript and Node.js for under-the-flag features) :) |
Vite 3.0? |
Vite 4.0? 😅 We need a smooth transition from cjs to esm. |
it would be good to support esm plugins in vite 3.0, so the ecosystem can gradually move to esm. we can imagine dropping cjs support at some point (vite v4/v5...) when the community is ready to accept. :) |
Feel free to open a PR that supports both types of plugins: cjs and esm |
I'm curious what you anticipate would be problematic. We've been supporting ESM-only for SvelteKit and have found it to be fairly smooth overall. |
In Vite v3, Vite will migrate to ESM (with CJS compat), the SSR build will also be ESM by default (with the current CJS SSR build as opt-in), and Vitest is used instead of Jest: We can close this issue for the moment to avoid having a generic request for a long time in the tracker. We think that going ESM-only isn't the best for the ecosystem right now, but Vite will make big steps towards that future in v3. |
I believe we should drop CJS support already in Vite 3, see #8432. |
Clear and concise description of the problem
CJS is alive.
Suggested solution
Kill it. By transitioning following tools to ESM-only.
This will effectively force the entire ecosystem to transition to ESM.
Note that old CJS packages can stay as-is and don't need any changes for the forseeable future. (But if they update one of their dependencies then they'll be forced to switch to ESM.)
Let's rip the band-aid off :-).
Explanation of why this will work: #4340 (comment).
Alternative
None 😉.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: