From fe18768dfcb34de4cce12a7dfd1abd2b92e8d8ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 18 Mar 2023 19:46:07 +0100 Subject: [PATCH] fix: fix ESM and CommonJS exports MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .eslintrc.js | 1 + CHANGELOG.md | 4 ++++ package.json | 11 +++++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 4852d04f..2e396436 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -48,6 +48,7 @@ module.exports = defineConfig({ 'inheritDoc', 'jsdoc', 'microjob', + 'mjs', 'num', 'os', 'piscina', diff --git a/CHANGELOG.md b/CHANGELOG.md index 66a14b8f..72a11850 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package.json b/package.json index bb5e866a..5ab4a576 100644 --- a/package.json +++ b/package.json @@ -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", -- 2.34.1