Created
March 24, 2016 14:52
-
-
Save ksmithbaylor/08d5422d7a95e9597cc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
function exec(command, env) { | |
require('child_process').execSync(command, { | |
stdio: 'inherit', | |
env: Object.assign({}, process.env, env, { | |
PATH: `./node_modules/.bin:${process.env.PATH}` | |
}) | |
}); | |
} | |
var environments = ['development', 'test', 'integration1', 'uat', 'prod']; | |
environments.forEach(env => { | |
gulp.task(`build:${env}`, () => { | |
exec(`echo Building ${env}`); | |
exec(`rimraf dist/${env}`); | |
exec(`webpack --color`, { | |
NODE_ENV: 'build', | |
MMR_ENV: env | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment