From dfedb6a14e1d6165b281e9bd3cde2406652aa116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Wed, 5 May 2021 09:37:57 -0500 Subject: [PATCH] Remove support for non-standard `module` field in `package.json` 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 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e15e4a7..8c76bac 100644 --- a/package.json +++ b/package.json @@ -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",