zoukankan      html  css  js  c++  java
  • [NPM] Run a set of similar npm scripts with a wildcard

    In this lesson we will run a set of scripts that are grouped together with a wildcard using the npm-run-all node package. Using this technique can help you simplify and organize your scripts.

    Install:

    npm i -D npm-run-all

    Instead of running 'eslint styleline mocha' by using npm-run-all:

        "test": "npm-run-all eslint stylelint mocha",
        "eslint": "eslint --cache --fix ./",
        "stylelint": "stylelint '**/*.scss' --syntax scss",

    We actually can group scripts by features:

        "test": "npm-run-all lint:* mocha","lint:js": "eslint --cache --fix ./",
        "lint:css": "stylelint '**/*.scss' --syntax scss",

    Here 'lint:*' will match 'lint:js' and 'lint:css' both.

    Also we can do:

        "test": "npm-run-all lint mocha",
        "lint": "npm-run-all lint:**",
        "lint:js": "eslint --cache --fix ./",
        "lint:css": "stylelint '**/*.scss' --syntax scss",
        "lint:css:fix": "stylefmt -R src/"

    Here 'lint:**' will match also two leavel deep ':' such as 'lint:css.fix'.

    PS: stylefmt lib will help to fix css if there is any lint error in css.

  • 相关阅读:
    JAVA :: MVC
    顺序栈创建
    editplus 配置工具集
    链表之创建
    13.1.22:线性表之单链表
    Web 多线程作业
    给 Mac OS X Lion 刻一张安装光盘
    kubernetes组件之api 安装
    kubeadm 之k8s 多master 部署
    kubernetes集群之部署kubescheduler组件
  • 原文地址:https://www.cnblogs.com/Answer1215/p/6363561.html
Copyright © 2011-2022 走看看