From cbfb558f85a81b0837074c064cc4290992e378a8 Mon Sep 17 00:00:00 2001 From: James Gillmore Date: Fri, 18 Aug 2017 07:20:59 -0700 Subject: [PATCH] fix($webpack): make up for fact that webpack creates chunks with hyphens for index files --- src/flushChunks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flushChunks.js b/src/flushChunks.js index 16c5da4..58646ec 100644 --- a/src/flushChunks.js +++ b/src/flushChunks.js @@ -195,7 +195,7 @@ 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.`) } @@ -203,7 +203,7 @@ const filesFromChunks = ( return result } - const entryToFiles = entry => assetsByChunkName[entry] + const entryToFiles = entry => assetsByChunkName[entry] || assetsByChunkName[entry+'-'] return [].concat(...chunkNames.filter(hasChunk).map(entryToFiles)) }