Skip to content

Commit

Permalink
cli(init): mode support to config
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvdutt committed Mar 23, 2018
1 parent f3c758c commit fbf681f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/generators/init-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ module.exports = class InitGenerator extends Generator {
Confirm("prodConfirm", "Are you going to use this in production?")
]);
})
.then(prodConfirmAnswer => this.isProd = prodConfirmAnswer["prodConfirm"])
.then(prodConfirmAnswer => {
this.isProd = prodConfirmAnswer["prodConfirm"];
this.configuration.config.webpackOptions.mode =
this.isProd ? `"${"production"}"` : `"${"development"}"`;
})
.then(() => {
return this.prompt([
Confirm("babelConfirm", "Will you be using ES2015?")
Expand Down

0 comments on commit fbf681f

Please sign in to comment.