diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index fa4f2bcad93e5..0cdf6c0626b6c 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -127,7 +127,7 @@ function buildLocalCommands(cli, isLocalSite) { }).option(`no-uglify`, { type: `boolean`, default: false, - describe: `Build site without uglifying JS bundles (for debugging).` + describe: `Build site without uglifying JS bundles (for debugging).`, }), handler: handlerP( getCommandHandler(`build`, (args, cmd) => { diff --git a/packages/gatsby/src/commands/build.js b/packages/gatsby/src/commands/build.js index 1966dee326251..05533d41a32b6 100644 --- a/packages/gatsby/src/commands/build.js +++ b/packages/gatsby/src/commands/build.js @@ -18,7 +18,7 @@ type BuildArgs = { sitePackageJson: object, browserslist: string[], prefixPaths: boolean, - noUglify: boolean + noUglify: boolean, } module.exports = async function build(program: BuildArgs) { diff --git a/packages/gatsby/src/utils/webpack.config.js b/packages/gatsby/src/utils/webpack.config.js index 55d2aaad90c75..fe161630f9a42 100644 --- a/packages/gatsby/src/utils/webpack.config.js +++ b/packages/gatsby/src/utils/webpack.config.js @@ -321,22 +321,24 @@ module.exports = async ( new GatsbyModulePlugin(), // new WebpackStableModuleIdAndHash({ seed: 9, hashSize: 47 }), new HashedChunkIdsPlugin(), - ]; - if(!noUglify) { + ] + if (!noUglify) { // Minify JavaScript. - plugins.push(new webpack.optimize.UglifyJsPlugin({ - compress: { - screw_ie8: true, // React doesn't support IE8 - warnings: false, - }, - mangle: { - screw_ie8: true, - }, - output: { - comments: false, - screw_ie8: true, - }, - })) + plugins.push( + new webpack.optimize.UglifyJsPlugin({ + compress: { + screw_ie8: true, // React doesn't support IE8 + warnings: false, + }, + mangle: { + screw_ie8: true, + }, + output: { + comments: false, + screw_ie8: true, + }, + }) + ) } return plugins }