I have two heroku node.js applications, one for prod and one for dev, and I also have a Gruntfile with dev- and prod-specific tasks. I know that you can configure package.json to run grunt as a postinstall hook for npm, but can you specify any different tasks to run depending on which environment you are in?
Here is what the relevant section of my package.json looks like:
"scripts": {
"postinstall": "./node_modules/grunt/bin/grunt default"
},
Instead of running grunt default each time, I would like to run "grunt production" if NODE_ENV is production, etc.
Is it possible?
source
share