Open drwpow opened 4 years ago
this is actually different, it's the process object specifically not getting polyfilled. But, this is still a useful task to work on.
the nice thing about CJS is that at this point, we just need it to work so that authors have time to upgrade to ESM, where they'll get all the optimizations we provide for free (especially around export maps for optimized bundling).
Another solution here is to specifically polyfill process.env.NODE_ENV
. That would be easy to do via regex replace and is safer than polyfilling the whole object. Since that is probably the most common use-case for using process
it could be a quick win.
Skypack does polyfill some Node built-ins, but only for the deep imports, not raw mode. Adding this would let us load many more packages (such as #37).