@@ -26,23 +26,23 @@ function getViewerData(bundleStats, bundleDir, opts) {
2626
2727 const isAssetIncluded = createAssetsFilter ( excludeAssets ) ;
2828
29- // Handle minimal stats format that only has assetsByChunkName but no assets array
30- if ( ( bundleStats . assets == null || bundleStats . assets . length === 0 ) && bundleStats . assetsByChunkName ) {
29+ // Handle minimal stats format that only has assetsByChunkName but no assets array
30+ if ( ( bundleStats . assets == null || bundleStats . assets . length === 0 ) && bundleStats . assetsByChunkName ) {
3131 // Convert assetsByChunkName to assets array for minimal stats
32- bundleStats . assets = [ ] ;
33- Object . entries ( bundleStats . assetsByChunkName ) . forEach ( ( [ chunkName , assetNames ] ) => {
34- assetNames . forEach ( assetName => {
35- bundleStats . assets . push ( {
36- name : assetName ,
37- chunks : [ chunkName ] ,
38- size : 0 // Default size for minimal stats
32+ bundleStats . assets = [ ] ;
33+ Object . entries ( bundleStats . assetsByChunkName ) . forEach ( ( [ chunkName , assetNames ] ) => {
34+ assetNames . forEach ( assetName => {
35+ bundleStats . assets . push ( {
36+ name : assetName ,
37+ chunks : [ chunkName ] ,
38+ size : 0 // Default size for minimal stats
39+ } ) ;
3940 } ) ;
4041 } ) ;
41- } ) ;
42- }
42+ }
4343
44- // Sometimes all the information is located in `children` array (e.g. problem in #10)
45- if ( ( bundleStats . assets == null || bundleStats . assets . length === 0 ) && bundleStats . children && bundleStats . children . length > 0 ) {
44+ // Sometimes all the information is located in `children` array (e.g. problem in #10)
45+ if ( ( bundleStats . assets == null || bundleStats . assets . length === 0 ) && bundleStats . children && bundleStats . children . length > 0 ) {
4646 const { children} = bundleStats ;
4747 bundleStats = bundleStats . children [ 0 ] ;
4848 // Sometimes if there are additional child chunks produced add them as child assets,
@@ -205,16 +205,16 @@ function getBundleModules(bundleStats) {
205205 if ( ! bundleStats ) {
206206 return [ ] ;
207207 }
208-
208+
209209 const seenIds = new Set ( ) ;
210-
210+
211211 // Safely handle chunks and modules that might be undefined
212- const chunksModules = bundleStats . chunks ?
213- bundleStats . chunks . map ( chunk => chunk . modules || [ ] ) :
212+ const chunksModules = bundleStats . chunks ?
213+ bundleStats . chunks . map ( chunk => chunk . modules || [ ] ) :
214214 [ ] ;
215-
215+
216216 const statsModules = bundleStats . modules || [ ] ;
217-
217+
218218 return flatten ( chunksModules . concat ( statsModules ) . filter ( Boolean ) ) . filter ( mod => {
219219 // Filtering out Webpack's runtime modules as they don't have ids and can't be parsed (introduced in Webpack 5)
220220 if ( isRuntimeModule ( mod ) ) {
0 commit comments