use pkg.exports; reorganize files

master
Conduitry 1 year ago
parent 205cde1d95
commit da1c4ee9e4
  1. 3
      .gitignore
  2. 0
      dist/index.d.ts
  3. 18
      package.json
  4. 4
      rollup.config.js

3
.gitignore vendored

@ -1,4 +1,5 @@
/dist/
/dist/*
!/dist/*.d.ts
/node_modules/
/package-lock.json
/pnpm-lock.yaml

@ -5,12 +5,20 @@
"keywords": [
"cache"
],
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "types/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
"types"
"*.md",
"dist"
],
"engines": {
"node": ">=12"

@ -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…
Cancel
Save