Skip to content

Commit

Permalink
Code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Nov 3, 2016
1 parent 28e84f3 commit ef75311
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/intermediate-representation-dir/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function shouldUpdateScroll (prevRouterProps, { location: { pathname } }) {
if (prevRouterProps) {
const { location: { pathname: oldPathname } } = prevRouterProps
if (oldPathname === pathname) {
return false
return false
}
}
return true
Expand Down
13 changes: 6 additions & 7 deletions lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, pages =
// of unused code on the initial opening of the app.
//
// Use Math.max as there must be at least two chunks.
minChunks: Math.max(2, Math.floor(components.length / 2)),
minChunks: Math.max(2, Math.floor(components.length / 3)),
}),
// Add a few global variables. Set NODE_ENV to production (enables
// optimizations for React) and whether prefixing links is enabled
Expand All @@ -221,21 +221,21 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, pages =
// rate for commons.js.
new ChunkManifestPlugin({
filename: "chunk-manifest.json",
manifestVariable: "webpackManifest"
manifestVariable: "webpackManifest",
}),
// Minify Javascript.
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true, // React doesn't support IE8
warnings: false
warnings: false,
},
mangle: {
screw_ie8: true
screw_ie8: true,
},
output: {
comments: false,
screw_ie8: true
}
screw_ie8: true,
},
}),
// Ensure module order stays the same. Supposibly fixed in webpack 2.0.
new webpack.optimize.OccurenceOrderPlugin(),
Expand Down Expand Up @@ -276,7 +276,6 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, pages =
// Hierarchy of directories for Webpack to look for module.
// First is the site directory.
// Then in the special directory of isomorphic modules Gatsby ships with.
// Then the site's node_modules directory
root: [
directory,
path.resolve(__dirname, `..`, `isomorphic`),
Expand Down

0 comments on commit ef75311

Please sign in to comment.