Skip to content

Commit 908c05c

Browse files
committed
apply initial and entry correctly with commons chunk
fixes webpack#642
1 parent ea34a15 commit 908c05c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/optimize/CommonsChunkPlugin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ CommonsChunkPlugin.prototype.apply = function(compiler) {
8888
usedChunks.forEach(function(chunk) {
8989
chunk.parents = [commonChunk];
9090
commonChunk.chunks.push(chunk);
91-
chunk.entry = false;
91+
if(chunk.initial)
92+
commonChunk.initial = true;
93+
if(chunk.entry) {
94+
commonChunk.entry = true;
95+
chunk.entry = false;
96+
}
9297
});
9398
if(filenameTemplate)
9499
commonChunk.filenameTemplate = filenameTemplate;

0 commit comments

Comments
 (0)