From: Jérôme Benoit Date: Sat, 18 Mar 2023 18:46:07 +0000 (+0100) Subject: fix: fix ESM and CommonJS exports X-Git-Tag: v2.3.10-0~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=fe18768dfcb34de4cce12a7dfd1abd2b92e8d8ce;p=poolifier.git fix: fix ESM and CommonJS exports Signed-off-by: Jérôme Benoit --- 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",