Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create .mjs entry points for module bundlers supporting ESM.
In modern bundlers (ex: [Webpack][1] and [Rollup][2]), .mjs have a higher priority than .js. This change will make those load ES modules instead of the commonjs versions, so the code can be [treeshaked][3] and [hoisted][4]. This will bypass the Babel build, but in general bundlers will use a compiler to support the ES* features needed. [1]: https://webpack.js.org/configuration/resolve/#resolve-extensions [2]: https://github.com/rollup/rollup-plugin-node-resolve#usage [3]: https://webpack.js.org/guides/tree-shaking/ [4]: https://webpack.js.org/plugins/module-concatenation-plugin/
- Loading branch information