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 May 5, 2021
1 parent 06a4321 commit 9357202
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"name": "@adeira/relay",
"private": false,
"version": "3.2.4",
"main": "src/index",
"module": false,
"main": "./src/index.js",
"sideEffects": false,
"homepage": "https://github.com/adeira/universe/tree/master/src/relay",
"description": "Opinionated wrapper around Relay - a JavaScript framework for building data-driven React applications",
Expand Down

0 comments on commit 9357202

Please sign in to comment.