From a42f6ddd3af4c354027e25df505e38fff2f66e18 Mon Sep 17 00:00:00 2001 From: Viorel Cojocaru Date: Tue, 20 Aug 2024 00:11:47 +0200 Subject: [PATCH] fix: Esm exports - add exports property - add type=module to lib-esm --- packages/plugin-webpack-filter/package.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/plugin-webpack-filter/package.json b/packages/plugin-webpack-filter/package.json index 4d24ca29f6..f658291c66 100644 --- a/packages/plugin-webpack-filter/package.json +++ b/packages/plugin-webpack-filter/package.json @@ -6,6 +6,13 @@ "module": "lib-esm/index.js", "types": "types/index.d.ts", "sideEffects": false, + "exports": { + ".": { + "import": "./lib-esm/index.js", + "require": "./lib/index.js", + "types": "./types/index.d.ts" + } + }, "engines": { "node": ">= 14.0" }, @@ -15,7 +22,7 @@ "scripts": { "build": "npm run clean && npm run build-lib && npm run build-esm", "build-lib": "npm run clean-lib && tsc --rootDir ./src --project tsconfig.lib.json --outDir ./lib", - "build-esm": "npm run clean-esm && tsc --rootDir ./src --project tsconfig.esm.json --outDir ./lib-esm", + "build-esm": "npm run clean-esm && tsc --rootDir ./src --project tsconfig.esm.json --outDir ./lib-esm && echo '{\"type\":\"module\"}' > lib-esm/package.json", "clean": "npm run clean-lib && npm run clean-esm", "clean-lib": "rimraf lib", "clean-esm": "rimraf lib-esm types",