[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.
[NPM] Run a set of similar npm scripts with a wildcard的更多相关文章
- npm run build报错(npm ERR! code ELIFECYCLE)的解决办法
具体报错如下图: 环境:centos7 应该node_modules安装问题,我们需要重新安装 rm -rf node_modules rm package-lock.json npm cache c ...
- vue2.x 在引用插件的时候,npm run dev跑正常 ,npm run build 报错vue-cli Unexpected token: punc (() [
这是因为,引用的插件在node_modules里,并不在vue-cli的es6编译范围内,所以语法报错,修改方法:
- Electron 桌面应用打包(npm run build)简述(windows + mac)
最近一段时间在用electron+vue做内部项目的一键构建发布系统的桌面应用,现就其中打包流程写个备注,以示记录. Windows环境打包:1.首先贴一下package.json. { " ...
- npm run build
[npm run build] npm 会在项目的 package.json 文件中寻找 scripts 区域,其中包括npm test和npm start等命令. 其实npm test和npm st ...
- 三面面试官:运行 npm run xxx 的时候发生了什么?
事情是这样的,直接开讲 面试官:npm run xxx的时候,发生了什么?讲的越详细越好. 我(心想,简单啊): 首先,DNS 解析,将域名解析成 IP 地址,然后 TCP 连接,TCP 三次握手.. ...
- VUE-CLI Vue安装及开发,npm run build无法查看项目的问题
Vue-cli 本地安装vue项目 需要安装node.js,用node命令行npm的方式安装Vue 步骤: 1.进入项目地址安装 npm install vue-cli -g 2.初始化一下 ESli ...
- 如何使用 gitlab 或 github 执行npm run build
一: 如何快速搭建一个组件库 首先,我们介绍一个快速包装组件库的工具:https://github.com/yanhaijing/jslib-base 按照文档来,就简单几步: npx @js ...
- [Whole Web] [Node.js] Using npm run to launch local scripts
npm run allows you to configure scripts inside of your package.json file which can access locally in ...
- [NPM] Run npm scripts in parallel
In this lesson we will look at running several npm scripts in parallel. Sometimes you don’t need scr ...
随机推荐
- 一筐梨子&一筐水果——协变性(covariant)
假设突然看见这个问题.我们常常会想当然. 一个梨子是水果,一筐梨子是一筐水果吗? watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveXFqMjA2NQ==/f ...
- Serializable中的serialVersionUID到底有啥用
最近在研究跨进程通信的问题,于是又再一次研究了,我们熟悉而又陌生的Serializable接口. 那么好,做过Java开发的朋友肯定对这个接口不陌生吧,Java中就是通过这个接口,来实现了序列化和反序 ...
- [Angular] Http Custom Headers and RequestOptions
updatePassenger(passenger: Passenger): Observable<Passenger> { let headers = new Headers({ 'Co ...
- amazeui学习笔记--css(布局相关1)--网格Grid
amazeui学习笔记--css(布局相关1)--网格Grid 一.总结 基本使用 1.div+class布局:amaze里面采取的就是div+class的布局方式 <div class=&q ...
- Day2:数据运算
一.算数运算 如: #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan print(10%2) #求模(取模) # 0 ...
- 读文件头数据判断 PE 文件格式和类型
namespace X.Reflection { using System; using System.IO; public static partial class ReflectionX { pu ...
- Dynamics CRM 2015/2016 Web API:Unbound Function 和 Bound Function
今天我们来看看Dynamics CRM Web API Function 吧, 这是一个新概念,刚接触的时候我也是比較的迷糊.这种命名确实是和之前的那套基于SOAP协议的API全然联系不上.好了,不说 ...
- android蓝牙主动发起配对实例
package cn.madfinger.core; import java.io.IOException; import java.lang.reflect.Method; import java. ...
- php实现运气模型(命运随机,克服困难)
php实现运气模型(命运随机,克服困难) 一.总结 1.应该用表格来布局的,这种多列的用表格布局比div和span布局方便很多 2.span标签设置宽度:变成行内快元素:display:inline- ...
- 1、Java快速入门
第一课 Java基础1. ubuntu上环境搭建 (建议使用我们提供的VMWare映象文件) 如果要自己安装ubuntu, 请参考<韦东山Android系统视频使用手册.pdf> ubun ...