好的script能够大大减少我们对命令行的操作,直接使用npm run xxx 就可以执行。
一、git相关
1. 查看分支
branch:git branch -a,
2. 查看标签
tag:git tag,
3. 创建标签
createtag:git tag -a 0.1.2 -m Release^-^,
4. 推送标签
pushtag:npm run createtag && git push origin --tags,
5. 删除分支
delbranch:git push origin --delete,
6. 同步git
fetch:git fetch -p,
7. 推送更新
push:git push origin master,
8. 提交代码
commit:git commit -a ,
9. 检出代码
checkout:git checkout,
10. 删除标签
deltag:git push origin --delete tag,
11. 删除己合并分支
delbranck:git branch -d,
12. 删除所分支
delbranchall:git branch -D,
13. 重命名分支
renamebranch:git branch -m,
二、webpack相关
1. 清空目录
clean:rimraf dist,
2. 构建项目
build:npm run clean && webpack --progress --colors --profile,
3. 启动项目
start:webpack-dev-server --progress --colors --profile,
4. 测试代码
test:karma start,
5. 检测测试
test-watch:karma start --auto-watch --no-single-run