SSR production build: Can I use ES6 modules? #2074
-
Hi, I'm using Vite's SSR together with Express. For certain reasons, I'm using the ES6 module syntax (i.e. import/export) for the whole project, not just for the Vite part.1 However, the SSR production build produced by I tried different options for Is there any way to tell Thanks a lot! 1: The thing is that I need a local module in both Express and Vite, and since Vite doesn't support |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For now the SSR build is always cjs for compatibility. You can use createRequire to load it in ESM mode. |
Beta Was this translation helpful? Give feedback.
For now the SSR build is always cjs for compatibility. You can use createRequire to load it in ESM mode.