webpack-bundle-analyzer 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/analyzer.js CHANGED
@@ -55,7 +55,7 @@ function getViewerData(bundleStats, bundleDir, opts) {
55
55
  }
56
56
 
57
57
  // Picking only `*.js, *.cjs or *.mjs` assets from bundle that has non-empty `chunks` array
58
- bundleStats.assets = bundleStats.assets.filter(asset => {
58
+ bundleStats.assets = (bundleStats.assets || []).filter(asset => {
59
59
  // Filter out non 'asset' type asset if type is provided (Webpack 5 add a type to indicate asset types)
60
60
  if (asset.type && asset.type !== 'asset') {
61
61
  return false;
@@ -114,7 +114,7 @@ function getViewerData(bundleStats, bundleDir, opts) {
114
114
  }
115
115
 
116
116
  // Picking modules from current bundle script
117
- let assetModules = modules.filter(statModule => assetHasModule(statAsset, statModule));
117
+ let assetModules = (modules || []).filter(statModule => assetHasModule(statAsset, statModule));
118
118
 
119
119
  // Adding parsed sources
120
120
  if (parsedModules) {
@@ -137,7 +137,7 @@ function getViewerData(bundleStats, bundleDir, opts) {
137
137
  unparsedEntryModules[0].parsedSrc = assetSources.runtimeSrc;
138
138
  } else {
139
139
  // If there are multiple entry points we move all of them under synthetic concatenated module.
140
- assetModules = assetModules.filter(mod => !unparsedEntryModules.includes(mod));
140
+ assetModules = (assetModules || []).filter(mod => !unparsedEntryModules.includes(mod));
141
141
  assetModules.unshift({
142
142
  identifier: './entry modules',
143
143
  name: './entry modules',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-bundle-analyzer",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap",
5
5
  "author": "Yury Grunin <grunin.ya@ya.ru>",
6
6
  "license": "MIT",
@@ -48,6 +48,7 @@
48
48
  "devDependencies": {
49
49
  "@babel/core": "7.26.9",
50
50
  "@babel/plugin-proposal-decorators": "7.25.9",
51
+ "@babel/plugin-transform-class-properties": "^7.27.1",
51
52
  "@babel/plugin-transform-runtime": "7.26.9",
52
53
  "@babel/preset-env": "7.26.9",
53
54
  "@babel/preset-react": "7.26.3",