mirror of
https://gitee.com/layui/layui.git
synced 2025-11-24 08:33:12 +08:00
build: 新增 CI 和生产环境跳过 husky 安装的判断 (#2918)
This commit is contained in:
6
.husky/install.mjs
Normal file
6
.husky/install.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
// 在生产环境和 CI 中跳过 Husky 安装
|
||||
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
|
||||
process.exit(0);
|
||||
}
|
||||
const husky = (await import('husky')).default;
|
||||
console.log(husky());
|
||||
@@ -43,7 +43,7 @@
|
||||
"format": "prettier --write --cache .",
|
||||
"format:check": "prettier --check --cache .",
|
||||
"lint": "eslint . --cache",
|
||||
"prepare": "husky",
|
||||
"prepare": "node .husky/install.mjs",
|
||||
"test": "jest --no-cache",
|
||||
"clean:dist": "del-cli dist/*",
|
||||
"release": "node scripts/release.mjs"
|
||||
|
||||
Reference in New Issue
Block a user