zoukankan      html  css  js  c++  java
  • [NPM] Use a shorthand syntax for running multiple npm scripts with npm-run-all

    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'

  • 相关阅读:
    学习进度条73
    学习进度条72
    学习进度条71
    学习进度条70
    学习进度条69
    学习进度条68
    学习进度条67
    学习进度条66
    学习进度条65
    elasticsearch
  • 原文地址:https://www.cnblogs.com/Answer1215/p/6363543.html
Copyright © 2011-2022 走看看