Often times you’ll have variations that you’ll want to make to your npm scripts and repeating yourself is inefficient and verbose. Instead you can create a base script and pass arguments into it from another script.

For example, you have a script:

"test": "mocha spec/ --require babel-register",

And you want to add a watcher to the test script:

"test:watch": "mocha spec/ --require babel-register --watch",

Here what we do is copy the script and add a '--watch' behind. This is not good enough, because if you want to change the 'test' script, you also need to modify the 'test:watch' script.

So what you can do:

"test:watch": "npm t -- --watch"

First '--' tell the compiler that we still need to pass in some arguments; And '--watch' is what we want to pass in.

最新文章

  1. 将bean转换成键值列表
  2. Js经典相册
  3. Action处理请求参数
  4. JavaScript基础篇
  5. javascript原型Prototype
  6. Lua从入门到精通
  7. window下配置SSH连接GitHub、GitHub配置ssh key(转)
  8. 百度上传插件WebUploader,angularjs指令封装
  9. iPhone开发:Objective C 代码规范-iOS总结版
  10. chrome extensions
  11. .NET C#到Java没那么难,DB篇
  12. SqlHelper工具类
  13. F#周报2019年第11期
  14. Linux SVN 操作详解(转)
  15. mysql学习笔记--数据库视图
  16. python学习笔记之自定义函数的导入
  17. 洛谷 P1441 砝码称重
  18. 20145215《网络对抗》Exp7 网络欺诈技术防范
  19. php中cal_days_in_month不可用时的替代方法(计算一个月的天数)
  20. 转【面向代码】学习 Deep Learning(二)Deep Belief Nets(DBNs)

热门文章

  1. 设计模式六大原则(五):迪米特法则(Law Of Demeter)
  2. 洛谷——U10783 名字被和谐了
  3. 洛谷 P2819 图的m着色问题
  4. IntelliJ IDEA 2018 Community(社区版)创建J2EE项目+Tomcat9部署
  5. 关于数据库中的JOIN的用法学习
  6. 洛谷 P2118 比例简化
  7. 2.CCGridAction(3D效果),3D反转特效,凸透镜特效,液体特效,3D翻页特效,水波纹特效,3D晃动的特效,扭曲旋转特效,波动特效,3D波动特效
  8. 24、驱动调试之printk
  9. linux 安装完mysql 密码重置
  10. FeatureLayer,FeatureDataset,FeatureClass,Feature的区别与联系总结