Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information