Skip to content

Commit a1533b9

Browse files
committed
feat: 更新打包工具为 rollup
1 parent ec96186 commit a1533b9

File tree

5 files changed

+353
-17
lines changed

5 files changed

+353
-17
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules/
22
lib/
3-
esm/
3+
es/
44
BADGE.md
55
release-toolbox.json

package.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
"type": "module",
66
"sideEffects": false,
77
"files": [
8-
"lib/"
8+
"lib",
9+
"es",
10+
"package.json",
11+
"README.md"
912
],
1013
"bin": {
11-
"badge": "/lib/cli.js"
14+
"badge": "./es/cli.js"
1215
},
13-
"main": "lib/index.js",
14-
"module": "lib/index.js",
15-
"types": "./lib/index.d.ts",
16-
"typings": "lib/index.d.ts",
16+
"main": "./lib/index.js",
17+
"module": "./es/index.js",
18+
"types": "./es/index.d.ts",
1719
"exports": {
1820
".": {
19-
"import": "./lib/index.js",
20-
"types": "./lib/index.d.ts"
21+
"require": "./lib/index.js",
22+
"import": "./es/index.js",
23+
"types": "./es/index.d.ts"
2124
}
2225
},
2326
"scripts": {
2427
"prepare": "husky install",
25-
"build:clean": "tsc --build --clean",
26-
"build:es": "tsc",
27-
"build:watch": "tsc --watch",
28-
"build": "npm run build:clean && npm run build:es",
28+
"build": "rollup -c",
2929
"release": "npm run build && rltb"
3030
},
3131
"repository": {
@@ -45,6 +45,9 @@
4545
},
4646
"homepage": "https://github.com/nmsn/badge#readme",
4747
"devDependencies": {
48+
"@rollup/plugin-commonjs": "^25.0.2",
49+
"@rollup/plugin-json": "^6.0.0",
50+
"@rollup/plugin-node-resolve": "^15.1.0",
4851
"@types/inquirer": "^9.0.3",
4952
"@types/node": "^20.2.6",
5053
"@typescript-eslint/eslint-plugin": "^5.59.9",
@@ -56,6 +59,9 @@
5659
"lint-staged": "^13.2.2",
5760
"prettier": "2.8.8",
5861
"release-toolbox": "0.2.0",
62+
"rollup": "^3.26.2",
63+
"rollup-plugin-clear": "^2.0.7",
64+
"rollup-plugin-typescript2": "^0.35.0",
5965
"tslib": "^2.5.3",
6066
"typescript": "^5.1.3"
6167
},

0 commit comments

Comments
 (0)