Reputation: 9935
For example:
"scripts": {
"watch": "coffee --watch --compile .; compass watch public/compass"
},
How can I get this working, so it compiles my coffescripts and my compass project?
Upvotes: 5
Views: 7437
Reputation: 38428
npm install parallelshell --save-dev
&
in your npm script(s)"build": "echo TODO: build the project and start watching",
"serve": "echo TODO: start a development web server",
"start": "parallelshell \"npm start build\" \"npm start serve\""
$ npm start
--- alternatively ---
Create a .js file that spins multiple processes via Node.js child_process. Here is an example:
"start": "node tools/start.js"
Where tools/start.js
may look like this:
https://github.com/kriasoft/aspnet-starter-kit/blob/master/tools/start.js
Upvotes: 2
Reputation: 961
http://substack.net/task_automation_with_npm_run
sequential sub-tasks
If you have 2 tasks you want to run in series, you can just npm run each task separated by a &&:
"build": "npm run build-js && npm run build-css"
parallel sub-tasks
If you want to run some tasks in parallel, just use & as the separator!
"watch": "npm run watch-js & npm run watch-css"
Upvotes: 21