[toc]
```
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
//基于cross-env包
//注意webpack配置文件的目录
"build:client": "cross-env NODE_ENV=production webpack --config build/webpack.config.client.js",
"build": "npm run clean && npm run build:client",
//基于rimraf包
"clean": "rimraf dist",
"lint": "eslint --ext .js --ext .jsx --ext .vue client/",
//eslint自动修正 最后client/ 为要修正的文件的所处目录
"lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue client/",
//必须用npm run,提交git前自动修正
"precommit": "npm run lint-fix",
"dev": "cross-env NODE_ENV=development webpack-dev-server --config build/webpack.config.client.js"
},
```
## 关于husky
husky 就是一款用于处理 git hooks 的npm包
![](https://box.kancloud.cn/d3c683c60bd6879939e0678d4b41bc6e_393x173.png)