18 ms·
The author addresses this issue directly in his follow up post [1]. He describes two ways to get watch functionality when using NPM as a build tool. First, "m
by edraferi 12y ago
The author addresses this issue directly in his follow up post [1]. He describes two ways to get watch functionality when using NPM as a build tool.
First, "most tools facilitate this option themselves - and usually are much more in tune with the intricacies of the files that should be listened for. For example Mocha has the -w option, as does Stylus, Node-Sass, Jade, Karma, and others." These options are simply invoked when the tool is called from NPM.
Second, "not all tools support this, and even when they do - you might want to compose multiple compile targets into one task which watches for changes and runs the whole set. There are tools that watch files and execute commands when files change, for example watch, onchange, dirwatch, or even nodemon."
[1] http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/ http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool...