I'm experimenting with setting up a dev environment to use NPM only, without the use of grunt.js or bower.js.
I followed this tutorial: http://beletsky.net/2015/04/npm-for-everything.html
I'm using nodemon to watch my .js and .scss files for changes which restarts the node server. So in my package.json file, under scripts I have
scripts:
"watch-js": "nodemon -e js --watch public/js -x \"npm run build-js\"",
"watch-sass": "nodemon -e scss --watch public/sass -x \"npm run build-sass\"",
"watch": "npm run watch-js & npm run watch-sass"
But when I run npm run watch
it only watches for the public/js files to change. And it triggers a build accordingly.
But it won't watch for the sass files.
Versions:
node v0.10.36
nodemon v1.4.1
I also include a build script which if I run compiles the sass to css, so my build-sass script should be ok
"build": "npm run build-js & npm run build-sass",
"watch": "npm run watch-js & npm run watch-sass"
-x
with-x \"echo js file changed\"
for both js and sass, and the messages were shown as expected for both. So it seemsnodemon
is working. Maybe the issue is in yourbuild-sass
script? – Robbie"build-sass": "node-sass public/sass/main.scss public/build/main.css",
I also have a build script with uses the build sass script and it works fine – conor909it won't watch for the sass files
, do you mean that the sass files are not getting rebuilt or that nodemon is not re-running the task? – Robbie