node.js - nodemon - ignore the file and path -
i using node js , nodemon module.
problem: if change file in front-end server automatically restarted.
expected: if change few js or few files inside path should not restart server.
i tried following code:
nodemon --ignore 'public/javascripts/template_files/*.js'
but above code not working. if change js files inside template_files folders means server restarting again , again.
based on comments have enough information explain what's going on.
in package.json, start script needs this:
"scripts" : { "start" : "nodemon ./bin/www --ignore 'public/javascripts/template_files/*.js'" }, that means, when run npm start, command nodemon should run (monitoring file changes), executing ./bin/www file, not monitoring specific js files. if file (other ignored files) changes, re-execute ./bin/www file.
what doing before trying execute nodemon --ignore 'public/javascripts/template_files/*.js' command line, won't execute particular file (iirc), , leaving start script nodemon ./bin/www, not ignore files want ignored.
make change package.json , use npm start. not type nodemon directly command line, there no need.
Comments
Post a Comment