fix: fix ESM and CommonJS exports
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Mar 2023 18:46:07 +0000 (19:46 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Mar 2023 18:46:07 +0000 (19:46 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.eslintrc.js
CHANGELOG.md
package.json

index 4852d04fd263b188492175c995457cd389974db2..2e396436b0d6d4c95af5a4764cb024fe2d1016ef 100644 (file)
@@ -48,6 +48,7 @@ module.exports = defineConfig({
           'inheritDoc',
           'jsdoc',
           'microjob',
+          'mjs',
           'num',
           'os',
           'piscina',
index 66a14b8f9e51d9976988e3d7fe6bca087881d098..72a11850adf1d2e88d4341948bb35d0494bedf73 100644 (file)
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+### Fixed
+
+- Fix `exports` syntax for ESM and CommonJS.
+
 ## [2.3.9] - 2023-03-18
 
 ### Changed
index bb5e866a8583bd9cd5012b89fab34149f721b322..5ab4a57686f5a84fae227d733842342fd9666d06 100644 (file)
@@ -3,10 +3,13 @@
   "version": "2.3.9",
   "description": "A fast, easy to use Node.js Worker Thread Pool and Cluster Pool implementation",
   "license": "MIT",
-  "exports": [
-    "lib/index.js",
-    "lib/index.mjs"
-  ],
+  "main": "lib/index.js",
+  "exports": {
+    ".": {
+      "require": "lib/index.js",
+      "import": "lib/index.mjs"
+    }
+  },
   "scripts": {
     "prepare": "node prepare.js",
     "build": "rollup --config --environment BUILD:development",