You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a new flag for this: --out-extension:.js=.mjs (as well as JavaScript and Go APIs). It's a mapping instead of a single value because I plan to have more file types in the future such as CSS and HTML, and you may want to customize those output extensions too. This was published in esbuild version 0.6.6.
Is it possible to transform the file extension in require statement too? Otherwise when I try to transform esm into cjs the require statement still says require('*.js') which would of course fail if the out extension has been changed to *.cjs
To have both ES module and CommonJS module co-exist in a Node.js package, we need to use different extensions, https://nodejs.org/api/esm.html#esm_enabling
The text was updated successfully, but these errors were encountered: