Skip to content

Commit 018ca1a

Browse files
committed
improve comments
1 parent 61ce0f7 commit 018ca1a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/optimize/CommonsChunkPlugin.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,16 @@ You can however specify the name of the async chunk by passing the desired strin
235235
return;
236236
}
237237

238-
// what is this?
238+
/**
239+
* If we find a "targetchunk" that is also a normal chunk (meaning it is probably specified as an entry)
240+
* and the current target chunk comes after that and the found chunk has a runtime*
241+
* make that chunk be an 'affected' chunk of the current target chunk.
242+
*
243+
* To understand what that means take a look at the "examples/chunkhash", this basically will
244+
* result in the runtime to be extracted to the current target chunk.
245+
*
246+
* *runtime: the "runtime" is the "webpack"-block you may have seen in the bundles that resolves modules etc.
247+
*/
239248
return allChunks.filter((chunk) => {
240249
const found = targetChunks.indexOf(chunk);
241250
if(found >= currentIndex) return false;

0 commit comments

Comments
 (0)