Skip to content

Commit

Permalink
cli(init): don't use uglify on prod config (#490)
Browse files Browse the repository at this point in the history
* cli(init): don't use uglify on prod config

* cli(init): revise preset opt
  • Loading branch information
evenstensberg committed Jun 4, 2018
1 parent 6b255c0 commit 6854bd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/generators/init-generator.js
Expand Up @@ -69,7 +69,6 @@ module.exports = class InitGenerator extends Generator {
this.configuration.config.webpackOptions.module = {
rules: []
};
this.configuration.config.webpackOptions.plugins = getDefaultPlugins();
this.configuration.config.topScope.push(
"const webpack = require('webpack')",
"const path = require('path')",
Expand Down Expand Up @@ -118,12 +117,12 @@ module.exports = class InitGenerator extends Generator {
}
})
.then(() => {
console.log(this.usingDefaults);
this.isProd = this.usingDefaults ? true : false;
this.configuration.config.configName = this.isProd ? "prod" : "dev";
this.configuration.config.webpackOptions.mode = this.isProd
? "'production'"
: "'development'";
this.configuration.config.webpackOptions.plugins = this.isProd ? [] : getDefaultPlugins();
return this.prompt([
Confirm("babelConfirm", "Will you be using ES2015?")
]);
Expand Down
4 changes: 1 addition & 3 deletions packages/generators/utils/module.js
Expand Up @@ -13,9 +13,7 @@ module.exports = _ => {
include: ["path.resolve(__dirname, 'src')"],
loader: "'babel-loader'",
options: {
presets: ["'env'", {
modules: false
}],
presets: [["'env'", { "'modules'": false }]],
plugins: ["'syntax-dynamic-import'"]
}
};
Expand Down

0 comments on commit 6854bd6

Please sign in to comment.