我有两个heroku node.js应用程序,一个用于prod,一个用于dev,我还有一个具有dev和prod特定任务的Gruntfile.我知道你可以设置package.json来运行grunt作为npm的postinstall挂钩,但是你可以指定不同的任务来运行,具体取决于你所在的enviro吗?
这是我的package.json的相关部分到目前为止的样子:
"scripts": {
"postinstall": "./node_modules/grunt/bin/grunt default"
},
Run Code Online (Sandbox Code Playgroud)
如果NODE_ENV是生产等,我不想每次都运行grunt默认值,而是喜欢运行"grunt production".
这可能吗?