For those who’d like to switch to NPM scripts as well, but don’t require big, custom tasks to be run, simply using the module’s CLI tools could be sufficient. (That is, if they come with a CLI.)
For instance, I self have these SASS NPM scripts in my package.json:
"scripts": {
"presass": "rimraf html/css",
"sass": "node-sass scss/index.scss html/css/screen.css --output-style=compressed",
"watch:sass": "watch \"npm run sass\" scss --interval=0.1"
}For the sass script I simply parse an input, output and a single parameter to the node-sass module. The watch:sass script uses the watch module to -ahum- watch the ./scss folder. (I personally don’t have a good experience using node-sass’ watch feature) The same can be done with modules such as Babel, webpack, browserify, etc…
This routine keeps your maintenance to a single file. But you do lose the absolute control of writing your task in a .js file like the article demonstrated.
