File tree Expand file tree Collapse file tree 6 files changed +44
-0
lines changed
test/statsCases/runtime-chunk-integration Expand file tree Collapse file tree 6 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class Chunk {
5050 this . ids = null ;
5151 this . debugId = debugId ++ ;
5252 this . name = name ;
53+ this . isRuntimeOnly = false ;
5354 this . entryModule = undefined ;
5455 this . _modules = new SortableSet ( undefined , sortByIdentifier ) ;
5556 this . _groups = new SortableSet ( undefined , sortById ) ;
@@ -265,6 +266,9 @@ class Chunk {
265266 }
266267 return true ;
267268 } ;
269+
270+ if ( otherChunk . isRuntimeOnly ) return false ;
271+
268272 if ( this . hasRuntime ( ) !== otherChunk . hasRuntime ( ) ) {
269273 if ( this . hasRuntime ( ) ) {
270274 return isAvailable ( this , otherChunk ) ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ module.exports = class RuntimeChunkPlugin {
2525 name = name ( entrypoint ) ;
2626 }
2727 const newChunk = compilation . addChunk ( name ) ;
28+ newChunk . isRuntimeOnly = true ;
2829 entrypoint . unshiftChunk ( newChunk ) ;
2930 newChunk . addGroup ( entrypoint ) ;
3031 entrypoint . setRuntimeChunk ( newChunk ) ;
Original file line number Diff line number Diff line change 1+ export default "b" ;
Original file line number Diff line number Diff line change 1+ Asset Size Chunks Chunk Names
2+ 0.js 287 bytes 0 [emitted]
3+ main1.js 386 bytes 1 [emitted] main1
4+ manifest.js 7.73 KiB 2 [emitted] manifest
5+ Entrypoint main1 = manifest.js main1.js
6+ [0] ./b.js 20 bytes {0} [built]
7+ [1] ./main1.js 36 bytes {1} [built]
Original file line number Diff line number Diff line change 1+ import ( "./b" ) ;
2+
3+ export default "a" ;
Original file line number Diff line number Diff line change 1+ const MinChunkSizePlugin = require ( "../../../lib/optimize/MinChunkSizePlugin" ) ;
2+
3+ module . exports = {
4+ mode : "production" ,
5+ target : "web" ,
6+ entry : {
7+ main1 : "./main1"
8+ } ,
9+ output : {
10+ filename : "[name].js"
11+ } ,
12+ optimization : {
13+ runtimeChunk : {
14+ name : "manifest"
15+ }
16+ } ,
17+ stats : {
18+ hash : false ,
19+ timings : false ,
20+ builtAt : false ,
21+ reasons : false
22+ } ,
23+ plugins : [
24+ new MinChunkSizePlugin ( {
25+ minChunkSize : 30
26+ } )
27+ ]
28+ } ;
You can’t perform that action at this time.
0 commit comments