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
build(package): ensure NodeJS considers ESM .js files as ESM
NodeJS treats JavaScript files as ESM when one of the following is true:
* The file is explicitly named `.mjs`
* The file is part of a directory where the closest `package.json` has
`type: module`.
Both things are not applying for the ESM output in `dist/esm` and
`dist/esm5` so these ESM artifacts cannot be used directly in NodeJS
because NodeJS will attempt loading them as CommonJS.
Note that this was not noticeable with e.g. bundlers like Webpack
as those do not rely on the NodeJS semantics for "detecting" ESM.
0 commit comments