Open
Description
typescript 文档请参考:https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing
package.json
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default":"./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default":"./dist/index.cjs"
}
}
},
"files": [
"dist"
],
"scripts": {
"test": "npm run build && cd ./test && npm run dev",
"clean": "rimraf dist",
"build": "rimraf dist && microbundle --target node -f esm,cjs"
},