framework
framework copied to clipboard
Polyfill cjs globals for vite
trafficstars
Ref nuxt/framework#1835, nuxt/bridge#190
Vite considers source input as native ESM while some dependencies might depend on Node.js/CJS globals like module and global. Doing polyfill can mitigate this potential issue (also making it more consistent with webpack that handles CJS at some level)
We can do it with unenv (#1502) or before that...
+1
+1