Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tsriram committed Mar 29, 2018
1 parent c5b9e7c commit 1c07193
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-cli/src/create-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type BuildArgs = {
sitePackageJson: object,
browserslist: string[],
prefixPaths: boolean,
noUglify: boolean
noUglify: boolean,
}

module.exports = async function build(program: BuildArgs) {
Expand Down
32 changes: 17 additions & 15 deletions packages/gatsby/src/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 1c07193

Please sign in to comment.