Skip to content

Commit

Permalink
fix: Export ESM modules
Browse files Browse the repository at this point in the history
- add exports property
- add type=module on lib-esm
  • Loading branch information
vio committed Aug 19, 2024
1 parent a34760f commit e3eefdf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/plugin-webpack-filter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand Down
9 changes: 8 additions & 1 deletion packages/plugin-webpack-validate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand Down

0 comments on commit e3eefdf

Please sign in to comment.