expose working CJS and ESM builds with pkg.exports
This commit is contained in:
parent
84f4a6c1fa
commit
4d22e70318
2 changed files with 11 additions and 4 deletions
11
package.json
11
package.json
|
@ -8,8 +8,15 @@
|
|||
"async",
|
||||
"watch"
|
||||
],
|
||||
"main": "dist/index.cjs.js",
|
||||
"module": "dist/index.esm.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "types/index.d.ts",
|
||||
"files": [
|
||||
"*.md",
|
||||
|
|
|
@ -5,7 +5,7 @@ export default {
|
|||
external: name => /^[a-z]/.test(name),
|
||||
plugins: [cheap_ts()],
|
||||
output: [
|
||||
{ file: 'dist/index.cjs.js', format: 'cjs', sourcemap: true, interop: false, preferConst: true },
|
||||
{ file: 'dist/index.esm.js', format: 'esm', sourcemap: true, preferConst: true },
|
||||
{ file: './dist/index.cjs', format: 'cjs', sourcemap: true, interop: false, preferConst: true },
|
||||
{ file: './dist/index.mjs', format: 'esm', sourcemap: true, preferConst: true },
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue