I have a heavy grunt setup, so when I'm only working on the backend, I run the app with this command
npm run gruntless
Here's how to make it:
app.js
var args = process.argv.slice(2);
function hasArg(arg){
return args.indexOf(arg) != -1;
}
var sails;
var rc;
Sails = require('sails').constructor;
rc = require('sails/accessible/rc');
sails = new Sails();
if(hasArg('--no-grunt')){
sails.log('Running with --no-grunt switch');
sails.lift({hooks: { grunt: false }}); // The important line
} else {
sails.lift(rc('sails')); // A normal lift
}
package.json
"scripts": {
...
"gruntless": "node app.js --no-grunt",
...
}