From 342030d8d8972b04522fd4505613ef3ad1d5dab7 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 28 Sep 2016 17:09:18 -0700 Subject: [PATCH] Ensure component names are unique --- lib/utils/webpack.config.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/utils/webpack.config.js b/lib/utils/webpack.config.js index b34dddc3cf5c5..2dea083f6d3c0 100644 --- a/lib/utils/webpack.config.js +++ b/lib/utils/webpack.config.js @@ -134,8 +134,9 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, pages = ] case `build-javascript`: { // Get array of page template component names. - let components = _.uniq(Array.from(pagesDB().values()).map(page => page.component)) + let components = Array.from(pagesDB().values()).map(page => page.component) components = components.map(component => layoutComponentChunkName(component)) + components = _.uniq(components) console.log('components', components) return [ // Moment.js includes 100s of KBs of extra localization data @@ -154,6 +155,7 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, pages = `app`, ...components, ], + children: false, // The more page components there are, the higher we raise the bar // for merging in page-specific JS libs into the commons chunk. The // two principles here is a) keep the TTI (time to interaction) as diff --git a/package.json b/package.json index b587297b6c77f..c83eba21b9f21 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gatsby", "description": "React.js Static Site Generator", - "version": "1.0.0-alpha.test5", + "version": "1.0.0-alpha.test7", "author": "Kyle Mathews ", "ava": { "require": [