Skip to content

Commit

Permalink
Ensure component names are unique
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Sep 29, 2016
1 parent dce5fef commit 342030d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"ava": {
"require": [
Expand Down

0 comments on commit 342030d

Please sign in to comment.