Skip to content

Commit 99bc48b

Browse files
committed
chore(build): 优化构建脚本添加清理命令
- 新增 clean 脚本用于删除 dist 目录 - 在 build:root 和 build:subdir 脚本前加入清理步骤 - 保证每次构建前环境干净避免遗留文件影响 - 提高构建流程的可靠性和一致性
1 parent 0ec388a commit 99bc48b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "vite build",
9-
"build:root": "VITE_BASE_PATH=/ vite build",
10-
"build:subdir": "vite build",
9+
"clean": "rm -rf dist",
10+
"build:root": "npm run clean && VITE_BASE_PATH=/ vite build",
11+
"build:subdir": "npm run clean && vite build",
1112
"lint": "eslint .",
1213
"preview": "vite preview",
1314
"init": "node scripts/init.js",

0 commit comments

Comments
 (0)