Convert Vite to pure ESM package #3979
raythurnvoid
started this conversation in
Ideas
Replies: 1 comment
-
I have the same problem :( SSR node service using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently Vite is a CommonJS package, one downside of this is that to load ES modules in SSR they have to be transformed in CommonJS and then executed.
By adding "type": "module" in Vite's package.json the
import("module.js")
could be used to load both CommonJS and ESM modules. Probably the wholessrTransform.ts
module could become unnecessary.Node supports ESM without any experimental flag from version 12.
Is this something that is already planned or there is something blocking it?
Beta Was this translation helpful? Give feedback.
All reactions