码迷,mamicode.com
首页 > 其他好文 > 详细

[NPM] Use a shorthand syntax for running multiple npm scripts with npm-run-all

时间:2017-02-03 22:51:40      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:this   gis   head   help   use   script   for   mount   ctr   

Running multiple scripts in series or in parallel can become very verbose. Using a tool such as npm-run-all can help reduce the amount of overhead you have to type in order to get the same behavior.

 

Install:

npm i -D npm-run-all

 

  "scripts": {
    "start": "node index.js",
    "test": "npm-run-all eslint stylelint mocha",
    "eslint": "eslint --cache --fix ./",
    "stylelint": "stylelint ‘**/*.scss‘ --syntax scss",
    "mocha": "mocha spec/ --require babel-register --watch"
  },

 

By default:

"test": "npm-run-all eslint stylelint mocha",

This will run in series.

 

TO make it run in parellel, we can add flag:

"test": "npm-run-all --parallel eslint mocha stylelint",

Here notice that we put ‘mocha‘ on the second, but we still able to stop it by ‘ctrl + c‘

[NPM] Use a shorthand syntax for running multiple npm scripts with npm-run-all

标签:this   gis   head   help   use   script   for   mount   ctr   

原文地址:http://www.cnblogs.com/Answer1215/p/6363543.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!