简体   繁体   English

从package.json观看手写笔

[英]Watch stylus from package.json

I'm running into a situation where i'm trying to watch my stylus file from my package.json but it's not working the way I'd like it to. 我遇到了一种情况,我试图从我的package.json查看我的手写笔文件,但它没有按照我想要的方式工作。 I have the following build script: 我有以下构建脚本:

"scripts": { ... "watch": "watchify public/components/**/* -o public/bundle.js -dv", "watch:css": "stylus -w public/css/styl/style.styl -o public/css/style.css", },

I can run both tasks separately and everything works, but I'd like to run npm run watch to handle both tasks but i haven't figured out a way. 我可以分别运行这两个任务,并且一切正常,但是我想运行npm run watch来处理这两个任务,但我还没有找到解决方法。 I prefer not to use a gulp or grunt. 我宁愿不要用大口小嘴或咕gr咕。的声音。 Can someone lend a hand? 有人可以伸出援手吗?

Ugh, very simple solution for this: gh,非常简单的解决方案:

change this: 改变这个:

"scripts": {
...
    "watch": "watchify public/components/**/* -o public/bundle.js -dv",
    "watch:css": "stylus -w public/css/styl/style.styl -o public/css/style.css",
  },

to this: 对此:

"scripts": {
...
    "watch": "watchify public/components/**/* -o public/bundle.js -dv & npm run watch:css",
    "watch:css": "stylus -w public/css/styl/style.styl -o public/css/style.css",
  },

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM