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", diff --git a/packages/plugin-webpack-validate/package.json b/packages/plugin-webpack-validate/package.json index 2e1eb2b0c8..d655f4c056 100644 --- a/packages/plugin-webpack-validate/package.json +++ b/packages/plugin-webpack-validate/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",