webpack-bundle-analyzer 4.8.0 → 4.9.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/CHANGELOG.md CHANGED
@@ -12,6 +12,11 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
12
12
 
13
13
  ## UNRELEASED
14
14
 
15
+ ## 4.9.0
16
+
17
+ * **Improvement**
18
+ * Display modules included in concatenated entry modules on Webpack 5 when "Show content of concatenated modules" is checked ([#602](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/602) by [@pgoldberg](https://github.com/pgoldberg))
19
+
15
20
  ## 4.8.0
16
21
 
17
22
  * **Improvement**
@@ -25,6 +25,26 @@ class ConcatenatedModule extends _Module.default {
25
25
  this.fillContentModules();
26
26
  }
27
27
 
28
+ get parsedSize() {
29
+ var _this$getParsedSize;
30
+
31
+ return (_this$getParsedSize = this.getParsedSize()) !== null && _this$getParsedSize !== void 0 ? _this$getParsedSize : this.getEstimatedSize('parsedSize');
32
+ }
33
+
34
+ get gzipSize() {
35
+ var _this$getGzipSize;
36
+
37
+ return (_this$getGzipSize = this.getGzipSize()) !== null && _this$getGzipSize !== void 0 ? _this$getGzipSize : this.getEstimatedSize('gzipSize');
38
+ }
39
+
40
+ getEstimatedSize(sizeType) {
41
+ const parentModuleSize = this.parent[sizeType];
42
+
43
+ if (parentModuleSize !== undefined) {
44
+ return Math.floor(this.size / this.parent.size * parentModuleSize);
45
+ }
46
+ }
47
+
28
48
  fillContentModules() {
29
49
  this.data.modules.forEach(moduleData => this.addContentModule(moduleData));
30
50
  }
@@ -47,7 +67,8 @@ class ConcatenatedModule extends _Module.default {
47
67
 
48
68
  currentFolder = childFolder;
49
69
  });
50
- const module = new _ContentModule.default(fileName, moduleData, this);
70
+ const ModuleConstructor = moduleData.modules ? ConcatenatedModule : _ContentModule.default;
71
+ const module = new ModuleConstructor(fileName, moduleData, this);
51
72
  currentFolder.addChildModule(module);
52
73
  }
53
74
 
@@ -37,10 +37,18 @@ class Module extends _Node.default {
37
37
  }
38
38
 
39
39
  get parsedSize() {
40
- return this.src ? this.src.length : undefined;
40
+ return this.getParsedSize();
41
41
  }
42
42
 
43
43
  get gzipSize() {
44
+ return this.getGzipSize();
45
+ }
46
+
47
+ getParsedSize() {
48
+ return this.src ? this.src.length : undefined;
49
+ }
50
+
51
+ getGzipSize() {
44
52
  if (!_lodash.default.has(this, '_gzipSize')) {
45
53
  this._gzipSize = this.src ? _gzipSize.default.sync(this.src) : undefined;
46
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-bundle-analyzer",
3
- "version": "4.8.0",
3
+ "version": "4.9.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",
@@ -83,7 +83,7 @@
83
83
  "style-loader": "2.0.0",
84
84
  "terser-webpack-plugin": "5.1.2",
85
85
  "url-loader": "4.1.1",
86
- "webpack": "5.37.1",
86
+ "webpack": "5.76.0",
87
87
  "webpack-cli": "3.3.12",
88
88
  "webpack-dev-server": "3.11.3"
89
89
  },