You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/webpack/entry-files-manifest-plugin.js
+41-6
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@
12
12
constlogger=require('../logger');
13
13
constfse=require('fs-extra');
14
14
15
+
constbugMessage='This is possibly a bug, but will not impact your setup unless you use the entrypoints.json (e.g. splitEntryChunks()) file. To be super awesome, please report this as an issue.';
@@ -36,7 +38,7 @@ function extractChunkIds(entryPoint) {
36
38
}elseif(/\.css$/.test(filename)){
37
39
files.cssChunkIds.push(chunk.id);
38
40
}else{
39
-
logger.debug(`Unable to determine file type for entry ${filename}. This is possibly a bug, but will not impact your setup unless you use the entrypoints.json file. To be super awesome, please report this as an issue.`);
41
+
logger.warning(`Unable to determine file type for entry ${filename}. ${bugMessage}`);
40
42
}
41
43
}
42
44
}
@@ -45,13 +47,46 @@ function extractChunkIds(entryPoint) {
45
47
}
46
48
47
49
functiongetChunkNameFromId(allChunks,chunkId){
48
-
returnallChunks.find(chunk=>{
50
+
constmatchedChunk=allChunks.find(chunk=>{
49
51
returnchunk.id===chunkId;
50
-
}).name;
52
+
});
53
+
54
+
if(!matchedChunk){
55
+
logger.warning(`Could not locate chunk with id ${chunkId}. ${bugMessage}`);
56
+
57
+
returnfalse;
58
+
}
59
+
60
+
if(typeofmatchedChunk.name!=='undefined'){
61
+
returnmatchedChunk.name;
62
+
}
63
+
64
+
// this can happen if the chunk was already split due to async code splitting
65
+
if(matchedChunk.files.length!==1){
66
+
logger.warning(`Found ${matchedChunk.files.length} files in chunk id ${matchedChunk.id} but expected exactly 1. ${bugMessage}`);
67
+
68
+
returnfalse;
69
+
}
70
+
71
+
// the only file has the correct filename (without versioning problems)
0 commit comments