File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export class ChunkGroup {
1515
1616 #inner: JsChunkGroup ;
1717
18+ #chunks = new VolatileValue < ReadonlyArray < Chunk > > ( ) ;
1819 #name = new VolatileValue < string | undefined > ( ) ;
1920
2021 static __from_binding ( binding : JsChunkGroup ) {
@@ -34,9 +35,14 @@ export class ChunkGroup {
3435 chunks : {
3536 enumerable : true ,
3637 get : ( ) => {
37- return this . #inner. chunks . map ( binding =>
38+ if ( this . #chunks. has ( ) ) {
39+ return this . #chunks. get ( ) ;
40+ }
41+ const chunks = this . #inner. chunks . map ( binding =>
3842 Chunk . __from_binding ( binding )
3943 ) ;
44+ this . #chunks. set ( chunks ) ;
45+ return chunks ;
4046 }
4147 } ,
4248 index : {
Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ export class Module {
211211 #rawRequest: string | undefined | null ;
212212 #resourceResolveData: ResolveData | undefined | null ;
213213 #matchResource: string | undefined | null ;
214+ #modules: Module [ ] | undefined | null ;
214215
215216 declare readonly context : string | null ;
216217 declare readonly resource : string | null ;
@@ -341,13 +342,17 @@ export class Module {
341342 } ,
342343 modules : {
343344 enumerable : true ,
344- get ( ) : Module [ ] | undefined {
345+ get : ( ) : Module [ ] | null => {
345346 if ( module instanceof JsModule ) {
346- return module . modules
347+ if ( this . #modules !== undefined ) {
348+ return this . #modules;
349+ }
350+ this . #modules = module . modules
347351 ? module . modules . map ( m => Module . __from_binding ( m ) )
348- : undefined ;
352+ : null ;
353+ return this . #modules;
349354 }
350- return undefined ;
355+ return null ;
351356 }
352357 } ,
353358 blocks : {
You can’t perform that action at this time.
0 commit comments