Skip to content

Commit

Permalink
fix($webpack): make up for fact that webpack creates chunks with hyph…
Browse files Browse the repository at this point in the history
…ens for index files
  • Loading branch information
faceyspacey authored Aug 18, 2017
1 parent 022ee42 commit cbfb558
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/flushChunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ const filesFromChunks = (
checkChunkNames?: boolean
): Files => {
const hasChunk = entry => {
const result = !!assetsByChunkName[entry]
const result = !!(assetsByChunkName[entry] || assetsByChunkName[entry+'-'])
if (!result && checkChunkNames) {
console.warn(`[FLUSH CHUNKS]: Unable to find ${entry} in Webpack chunks. Please check usage of Babel plugin.`)
}

return result
}

const entryToFiles = entry => assetsByChunkName[entry]
const entryToFiles = entry => assetsByChunkName[entry] || assetsByChunkName[entry+'-']

return [].concat(...chunkNames.filter(hasChunk).map(entryToFiles))
}
Expand Down

0 comments on commit cbfb558

Please sign in to comment.