Closed ryancole closed 9 years ago
Ah, I'm on Windows. I don't think this pipe feature is available.
Ohh sorry about that. Let me know if you find a solution for that in Windows!
I actually found a way that works on both linux and windows. The actual issue, originally, was that the watch-css
npm task was using single quotes, which didn't work on Windows. So, changing those to escaped double quotes fixed the watch-css
task.
Another problem came up though, being that I couldn't figure out how to run multiple npm tasks in parallel on Windows. On Linux, everybody just uses the ampersands. On Windows, I got this to work by using another npm module - npm-run-all
.
So, with those two adjustments, I've got this scripts section working well on both Linux and Windows ...
"scripts": {
"build": "npm-run-all --parallel build-js build-css",
"watch": "npm-run-all --parallel watch-js watch-css",
"build-js": "browserify src/app.jsx | uglifyjs > build/app.js",
"build-css": "rework-npm index.css | cleancss -o build/app.css",
"watch-js": "watchify src/app.jsx -o build/app.js --debug --verbose",
"watch-css": "nodemon -e css --ignore build --exec \"rework-npm index.css -o build/app.css\""
}
That's awesome :).
Are you willing to send a PR with this?
Thanks!
I'm trying to issue the
watch-css
npm script. I get an error saying thatrework-npm
is not a valid command. I can runrework-npm
through command line just fine, though. I don't think nodemon is able to run it, though?