Skip to content

Commit

Permalink
Remove support for non-standard module field in package.json
Browse files Browse the repository at this point in the history
This commit removes support for non-standard `"module"` field in `package.json`. Purpose of this field was to implement support for ES modules in its early days. This used to be a common way how to do it in bundlers, see:

- Webpack: https://webpack.js.org/guides/author-libraries/#final-steps
- Rollup: https://github.com/rollup/rollup/wiki/pkg.module
- https://stackoverflow.com/questions/42708484/what-is-the-module-package-json-field-for

However, seems like the whole system around ES modules evolved a bit differently (top level field `"type": "module"` + field `"exports"`), see:

- https://nodejs.org/api/packages.html
- https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
- https://babeljs.io/blog/2021/02/22/7.13.0#automatic-es-modules-in-babelruntime-12632httpsgithubcombabelbabelpull12632

This change is essentially a cleanup of our quirky and non-standard solution in order to be able to implement this modern approach.

adeira-source-id: 4644aba7bc5690c298125e68afabd878a2cd9fc6
  • Loading branch information
mrtnzlml authored and adeira-github-bot committed Jul 6, 2021
1 parent aa53382 commit dfedb6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"private": false,
"version": "1.0.1",
"main": "src/index",
"main": "./src/index.js",
"sideEffects": false,
"dependencies": {
"@adeira/js": "^2.1.0",
Expand Down

0 comments on commit dfedb6a

Please sign in to comment.