Skip to content

Instantly share code, notes, and snippets.

@ksmithbaylor
Created March 24, 2016 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksmithbaylor/08d5422d7a95e9597cc0 to your computer and use it in GitHub Desktop.
Save ksmithbaylor/08d5422d7a95e9597cc0 to your computer and use it in GitHub Desktop.
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