webpack-bundle-analyzer 2.8.3 → 2.10.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 +46 -11
- package/LICENSE +1 -3
- package/README.md +143 -71
- package/lib/BundleAnalyzerPlugin.js +27 -10
- package/lib/parseUtils.js +1 -1
- package/lib/viewer.js +9 -0
- package/package.json +37 -37
- package/public/viewer.js +1 -1
- package/public/viewer.js.map +1 -1
- package/src/BundleAnalyzerPlugin.js +18 -10
- package/src/analyzer.js +1 -1
- package/src/parseUtils.js +1 -1
- package/src/viewer.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,41 @@
|
|
|
10
10
|
|
|
11
11
|
_Note: Gaps between patch versions are faulty, broken or test releases._
|
|
12
12
|
|
|
13
|
+
## UNRELEASED
|
|
14
|
+
|
|
15
|
+
<!-- Add changelog entries for new changes under this section -->
|
|
16
|
+
|
|
17
|
+
## 2.10.0
|
|
18
|
+
|
|
19
|
+
* **Bug Fix**
|
|
20
|
+
* Fix "out of memory" crash when dealing with huge stats objects ([#129](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/129), [@ryan953](https://github.com/ryan953))
|
|
21
|
+
|
|
22
|
+
* **Internal**
|
|
23
|
+
* Update dependencies ([#146](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/146))
|
|
24
|
+
* Update gulp to v4 and simplify gulpfile ([#146](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/146), [#149](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/149))
|
|
25
|
+
* Simplify ESLint configs ([#148](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/148))
|
|
26
|
+
|
|
27
|
+
## 2.9.2
|
|
28
|
+
|
|
29
|
+
* **Bug Fix**
|
|
30
|
+
* Add a listener for the 'error' event on the WebSocket server client (#140)
|
|
31
|
+
|
|
32
|
+
* **Internal**
|
|
33
|
+
* Clean up .travis.yml (#140)
|
|
34
|
+
* Update ws to version 4.0.0 (#140)
|
|
35
|
+
|
|
36
|
+
## 2.9.1
|
|
37
|
+
|
|
38
|
+
* **Bug Fix**
|
|
39
|
+
* Bump `ws` dependency to fix DoS vulnerability (closes [#130](https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/130))
|
|
40
|
+
|
|
41
|
+
## 2.9.0
|
|
42
|
+
* **New Feature**
|
|
43
|
+
* Show chunk sizes in sidebar (closes #91)
|
|
44
|
+
|
|
45
|
+
* **Bug Fix**
|
|
46
|
+
* Properly parse webpack bundles that use arrow functions as module wrappers (#108, @regiontog)
|
|
47
|
+
|
|
13
48
|
## 2.8.3
|
|
14
49
|
* **Bug Fix**
|
|
15
50
|
* Correctly advertise port when using a random one (#89, @yannickcr)
|
|
@@ -19,7 +54,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
|
|
|
19
54
|
## 2.8.2
|
|
20
55
|
* **Improvement**
|
|
21
56
|
* Greatly improved accuracy of gzip sizes
|
|
22
|
-
|
|
57
|
+
|
|
23
58
|
* **Bug Fix**
|
|
24
59
|
* Generate report file in the bundle output directory when used with Webpack Dev Server (fixes #75)
|
|
25
60
|
|
|
@@ -31,7 +66,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
|
|
|
31
66
|
* **Improvement**
|
|
32
67
|
* Analyzer now supports `webpack --watch` and Webpack Dev Server!
|
|
33
68
|
It will automatically update modules treemap according to changes in the sources via WebSockets!
|
|
34
|
-
|
|
69
|
+
|
|
35
70
|
* **Internal**
|
|
36
71
|
* Use `babel-preset-env` and two different Babel configs to compile node and browser code
|
|
37
72
|
* Update deps
|
|
@@ -55,7 +90,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
|
|
|
55
90
|
## 2.4.0
|
|
56
91
|
* **Bug Fix**
|
|
57
92
|
* Fix `TypeError: currentFolder.addModule is not a function`
|
|
58
|
-
|
|
93
|
+
|
|
59
94
|
* **Internal**
|
|
60
95
|
* Update deps
|
|
61
96
|
|
|
@@ -66,7 +101,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
|
|
|
66
101
|
## 2.3.0
|
|
67
102
|
* **Improvement**
|
|
68
103
|
* Add `analyzerHost` option (@freaz)
|
|
69
|
-
|
|
104
|
+
|
|
70
105
|
* **Internal**
|
|
71
106
|
* Update deps
|
|
72
107
|
|
|
@@ -124,37 +159,37 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
|
|
|
124
159
|
* Workaround `Express` bug that caused wrong `ejs` version to be used as view engine (fixes #17)
|
|
125
160
|
|
|
126
161
|
## 1.5.2
|
|
127
|
-
|
|
162
|
+
|
|
128
163
|
* **Bug Fix**
|
|
129
164
|
* Support array module descriptors that can be generated if `DedupePlugin` is used (fixes #4)
|
|
130
165
|
|
|
131
166
|
## 1.5.1
|
|
132
|
-
|
|
167
|
+
|
|
133
168
|
* **Internal**
|
|
134
169
|
* Plug analyzer to Webpack compiler `done` event instead of `emit`. Should fix #15.
|
|
135
170
|
|
|
136
171
|
## 1.5.0
|
|
137
|
-
|
|
172
|
+
|
|
138
173
|
* **New Feature**
|
|
139
174
|
* Add `statsOptions` option for `BundleAnalyzerPlugin`
|
|
140
175
|
|
|
141
176
|
## 1.4.2
|
|
142
|
-
|
|
177
|
+
|
|
143
178
|
* **Bug Fix**
|
|
144
179
|
* Fix "Unable to find bundle asset" error when bundle name starts with `/` (fixes #3)
|
|
145
180
|
|
|
146
181
|
## 1.4.1
|
|
147
|
-
|
|
182
|
+
|
|
148
183
|
* **Bug Fix**
|
|
149
184
|
* Add partial support for `DedupePlugin` (see #4 for more info)
|
|
150
185
|
|
|
151
186
|
## 1.4.0
|
|
152
|
-
|
|
187
|
+
|
|
153
188
|
* **New Feature**
|
|
154
189
|
* Add "static report" mode (closes #2)
|
|
155
190
|
|
|
156
191
|
## 1.3.0
|
|
157
|
-
|
|
192
|
+
|
|
158
193
|
* **Improvement**
|
|
159
194
|
* Add `startAnalyzer` option for `BundleAnalyzerPlugin` (fixes #1)
|
|
160
195
|
* **Internal**
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,99 +1,134 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
[![npm][npm]][npm-url]
|
|
2
|
+
[![node][node]][node-url]
|
|
3
|
+
[![deps][deps]][deps-url]
|
|
4
|
+
[![tests][tests]][tests-url]
|
|
5
|
+
[![downloads][downloads]][downloads-url]
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
<a href="https://github.com/webpack/webpack">
|
|
9
|
+
<img width="200" height="200"
|
|
10
|
+
src="https://webpack.js.org/assets/icon-square-big.svg">
|
|
11
|
+
</a>
|
|
12
|
+
<h1>Webpack Bundle Analyzer</h1>
|
|
13
|
+
<p>Visualize size of webpack output files with an interactive zoomable treemap.</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<h2 align="center">Install</h2>
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install --save-dev webpack-bundle-analyzer
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
<h2 align="center">Usage (as a plugin)</h2>
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
3
26
|
|
|
4
|
-
|
|
27
|
+
module.exports = {
|
|
28
|
+
plugins: [
|
|
29
|
+
new BundleAnalyzerPlugin()
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
```
|
|
5
33
|
|
|
6
|
-
|
|
7
|
-
Just take a look at this demo:
|
|
34
|
+
It will create an interactive treemap visualization of the contents of all your bundles.
|
|
8
35
|
|
|
9
36
|

|
|
10
37
|
|
|
11
38
|
This module will help you:
|
|
12
39
|
|
|
13
40
|
1. Realize what's *really* inside your bundle
|
|
14
|
-
2. Find out what modules make up the most of
|
|
41
|
+
2. Find out what modules make up the most of its size
|
|
15
42
|
3. Find modules that got there by mistake
|
|
16
43
|
4. Optimize it!
|
|
17
44
|
|
|
18
45
|
And the best thing is it supports minified bundles! It parses them to get real size of bundled modules.
|
|
19
46
|
And it also shows their gzipped sizes!
|
|
20
47
|
|
|
21
|
-
|
|
22
|
-
There are two ways to use this module:
|
|
48
|
+
<h2 align="center">Options (for plugin)</h2>
|
|
23
49
|
|
|
24
|
-
### As plugin
|
|
25
|
-
```sh
|
|
26
|
-
npm install --save-dev webpack-bundle-analyzer
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
In `webpack.config.js`:
|
|
30
50
|
```js
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// ...
|
|
34
|
-
plugins: [new BundleAnalyzerPlugin()]
|
|
35
|
-
// ...
|
|
51
|
+
new BundleAnalyzerPlugin(options?: object)
|
|
36
52
|
```
|
|
37
53
|
|
|
38
|
-
|
|
54
|
+
|Name|Type|Description|
|
|
55
|
+
|:--:|:--:|:----------|
|
|
56
|
+
|**`analyzerMode`**|One of: `server`, `static`, `disabled`|Default: `server`. In `server` mode analyzer will start HTTP server to show bundle report. In `static` mode single HTML file with bundle report will be generated. In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`. |
|
|
57
|
+
|**`analyzerHost`**|`{String}`|Default: `127.0.0.1`. Host that will be used in `server` mode to start HTTP server.|
|
|
58
|
+
|**`analyzerPort`**|`{Number}`|Default: `8888`. Port that will be used in `server` mode to start HTTP server.|
|
|
59
|
+
|**`reportFilename`**|`{String}`|Default: `report.html`. Path to bundle report file that will be generated in `static` mode. Relative to bundle output directory (which is `output.path` in webpack config).|
|
|
60
|
+
|**`defaultSizes`**|One of: `stat`, `parsed`, `gzip`|Default: `parsed`. Module sizes to show in report by default. [Size definitions](#size-definitions) section describes what these values mean.|
|
|
61
|
+
|**`openAnalyzer`**|`{Boolean}`|Default: `true`. Automatically open report in default browser.|
|
|
62
|
+
|**`generateStatsFile`**|`{Boolean}`|Default: `false`. If `true`, webpack stats JSON file will be generated in bundle output directory|
|
|
63
|
+
|**`statsFilename`**|`{String}`|Default: `stats.json`. Name of webpack stats JSON file that will be generated if `generateStatsFile` is `true`. Relative to bundle output directory.|
|
|
64
|
+
|**`statsOptions`**|`null` or `{Object}`|Default: `null`. Options for `stats.toJson()` method. For example you can exclude sources of your modules from stats file with `source: false` option. [See more options here](https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21). |
|
|
65
|
+
|**`logLevel`**|One of: `info`, `warn`, `error`, `silent`|Default: `info`. Used to control how much details the plugin outputs.|
|
|
39
66
|
|
|
40
|
-
|
|
41
|
-
new BundleAnalyzerPlugin({
|
|
42
|
-
// Can be `server`, `static` or `disabled`.
|
|
43
|
-
// In `server` mode analyzer will start HTTP server to show bundle report.
|
|
44
|
-
// In `static` mode single HTML file with bundle report will be generated.
|
|
45
|
-
// In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`.
|
|
46
|
-
analyzerMode: 'server',
|
|
47
|
-
// Host that will be used in `server` mode to start HTTP server.
|
|
48
|
-
analyzerHost: '127.0.0.1',
|
|
49
|
-
// Port that will be used in `server` mode to start HTTP server.
|
|
50
|
-
analyzerPort: 8888,
|
|
51
|
-
// Path to bundle report file that will be generated in `static` mode.
|
|
52
|
-
// Relative to bundles output directory.
|
|
53
|
-
reportFilename: 'report.html',
|
|
54
|
-
// Module sizes to show in report by default.
|
|
55
|
-
// Should be one of `stat`, `parsed` or `gzip`.
|
|
56
|
-
// See "Definitions" section for more information.
|
|
57
|
-
defaultSizes: 'parsed',
|
|
58
|
-
// Automatically open report in default browser
|
|
59
|
-
openAnalyzer: true,
|
|
60
|
-
// If `true`, Webpack Stats JSON file will be generated in bundles output directory
|
|
61
|
-
generateStatsFile: false,
|
|
62
|
-
// Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`.
|
|
63
|
-
// Relative to bundles output directory.
|
|
64
|
-
statsFilename: 'stats.json',
|
|
65
|
-
// Options for `stats.toJson()` method.
|
|
66
|
-
// For example you can exclude sources of your modules from stats file with `source: false` option.
|
|
67
|
-
// See more options here: https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21
|
|
68
|
-
statsOptions: null,
|
|
69
|
-
// Log level. Can be 'info', 'warn', 'error' or 'silent'.
|
|
70
|
-
logLevel: 'info'
|
|
71
|
-
})
|
|
72
|
-
```
|
|
67
|
+
<h2 align="center">Usage (as a CLI utility)</h2>
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
You can also analyze already existing bundles if you have Webpack Stats JSON file.
|
|
69
|
+
You can analyze an existing bundle if you have a webpack stats JSON file.
|
|
76
70
|
|
|
77
71
|
You can generate it using `BundleAnalyzerPlugin` with `generateStatsFile` option set to `true` or with this simple
|
|
78
72
|
command:
|
|
79
73
|
|
|
80
|
-
```
|
|
74
|
+
```bash
|
|
81
75
|
webpack --profile --json > stats.json
|
|
82
76
|
```
|
|
83
77
|
|
|
84
|
-
If you're on Windows and using PowerShell, you can generate the stats file with this command to [avoid BOM issues](https://github.com/
|
|
78
|
+
If you're on Windows and using PowerShell, you can generate the stats file with this command to [avoid BOM issues](https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/47):
|
|
85
79
|
|
|
86
80
|
```
|
|
87
81
|
webpack --profile --json | Out-file 'stats.json' -Encoding OEM
|
|
88
82
|
```
|
|
89
83
|
|
|
90
|
-
|
|
84
|
+
Then you can run the CLI tool.
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
webpack-bundle-analyzer bundle/output/path/stats.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
<h2 align="center">Options (for CLI)</h2>
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
webpack-bundle-analyzer <bundleStatsFile> [bundleDir] [options]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Arguments are documented below:
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
### `bundleStatsFile`
|
|
93
99
|
|
|
94
|
-
webpack
|
|
100
|
+
Path to webpack stats JSON file
|
|
95
101
|
|
|
96
|
-
###
|
|
102
|
+
### `bundleDir`
|
|
103
|
+
|
|
104
|
+
Directory containing all generated bundles.
|
|
105
|
+
|
|
106
|
+
### `options`
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
-h, --help output usage information
|
|
110
|
+
-V, --version output the version number
|
|
111
|
+
-m, --mode <mode> Analyzer mode. Should be `server` or `static`.
|
|
112
|
+
In `server` mode analyzer will start HTTP server to show bundle report.
|
|
113
|
+
In `static` mode single HTML file with bundle report will be generated.
|
|
114
|
+
Default is `server`.
|
|
115
|
+
-h, --host <host> Host that will be used in `server` mode to start HTTP server.
|
|
116
|
+
Default is `127.0.0.1`.
|
|
117
|
+
-p, --port <n> Port that will be used in `server` mode to start HTTP server.
|
|
118
|
+
Default is 8888.
|
|
119
|
+
-r, --report <file> Path to bundle report file that will be generated in `static` mode.
|
|
120
|
+
Default is `report.html`.
|
|
121
|
+
-s, --default-sizes <type> Module sizes to show in treemap by default.
|
|
122
|
+
Possible values: stat, parsed, gzip
|
|
123
|
+
Default is `parsed`.
|
|
124
|
+
-O, --no-open Don't open report in default browser automatically.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
<h2 align="center" id="size-definitions">Size definitions</h2>
|
|
128
|
+
|
|
129
|
+
webpack-bundle-analyzer reports three values for sizes. `defaultSizes` can be used to control which of these is shown by default. The different reported sizes are:
|
|
130
|
+
|
|
131
|
+
### `stat`
|
|
97
132
|
|
|
98
133
|
This is the "input" size of your files, before any transformations like
|
|
99
134
|
minification.
|
|
@@ -101,23 +136,60 @@ minification.
|
|
|
101
136
|
It is called "stat size" because it's obtained from Webpack's
|
|
102
137
|
[stats object](https://webpack.js.org/configuration/stats/).
|
|
103
138
|
|
|
104
|
-
###
|
|
139
|
+
### `parsed`
|
|
105
140
|
|
|
106
141
|
This is the "output" size of your files. If you're using a Webpack plugin such
|
|
107
142
|
as Uglify, then this value will reflect the minified size of your code.
|
|
108
143
|
|
|
109
|
-
###
|
|
144
|
+
### `gzip`
|
|
110
145
|
|
|
111
|
-
This is the size of running the
|
|
146
|
+
This is the size of running the parsed bundles/modules through gzip compression.
|
|
112
147
|
|
|
113
|
-
|
|
148
|
+
<h2 align="center">Troubleshooting</h2>
|
|
114
149
|
|
|
115
|
-
|
|
150
|
+
### I can't see all the dependencies in a chunk
|
|
151
|
+
|
|
152
|
+
This is a known caveat when `webpack.optimize.ModuleConcatenationPlugin` is used. The way `ModuleConcatenationPlugin` works is that it merges multiple modules into a single one, and so that resulting module doesn't have edges anymore.
|
|
116
153
|
|
|
117
|
-
|
|
154
|
+
If you are interested to drill down to exact dependencies, try analyzing your bundle without `ModuleConcatenationPlugin`. See [issue #115](https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/115) for more discussion.
|
|
118
155
|
|
|
119
|
-
|
|
156
|
+
<h2 align="center">Maintainers</h2>
|
|
120
157
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
158
|
+
<table>
|
|
159
|
+
<tbody>
|
|
160
|
+
<tr>
|
|
161
|
+
<td align="center">
|
|
162
|
+
<img width="150" height="150"
|
|
163
|
+
src="https://avatars3.githubusercontent.com/u/302213?v=4&s=150">
|
|
164
|
+
</br>
|
|
165
|
+
<a href="https://github.com/th0r">Yuriy Grunin</a>
|
|
166
|
+
</td>
|
|
167
|
+
<td align="center">
|
|
168
|
+
<img width="150" height="150"
|
|
169
|
+
src="https://avatars3.githubusercontent.com/u/482561?v=4&s=150">
|
|
170
|
+
</br>
|
|
171
|
+
<a href="https://github.com/valscion">Vesa Laakso</a>
|
|
172
|
+
</td>
|
|
173
|
+
</tr>
|
|
174
|
+
<tbody>
|
|
175
|
+
</table>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
[npm]: https://img.shields.io/npm/v/webpack-bundle-analyzer.svg
|
|
179
|
+
[npm-url]: https://npmjs.com/package/webpack-bundle-analyzer
|
|
180
|
+
|
|
181
|
+
[node]: https://img.shields.io/node/v/webpack-bundle-analyzer.svg
|
|
182
|
+
[node-url]: https://nodejs.org
|
|
183
|
+
|
|
184
|
+
[deps]: https://david-dm.org/webpack-contrib/webpack-bundle-analyzer.svg
|
|
185
|
+
[deps-url]: https://david-dm.org/webpack-contrib/webpack-bundle-analyzer
|
|
186
|
+
|
|
187
|
+
[tests]: http://img.shields.io/travis/webpack-contrib/webpack-bundle-analyzer.svg
|
|
188
|
+
[tests-url]: https://travis-ci.org/webpack-contrib/webpack-bundle-analyzer
|
|
189
|
+
|
|
190
|
+
[downloads]: https://img.shields.io/npm/dt/webpack-bundle-analyzer.svg
|
|
191
|
+
[downloads-url]: https://npmjs.com/package/webpack-bundle-analyzer
|
|
192
|
+
|
|
193
|
+
<h2 align="center">Contributing</h2>
|
|
194
|
+
|
|
195
|
+
Check out [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on contributing :tada:
|
|
@@ -6,7 +6,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
6
6
|
|
|
7
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var bfj = require('bfj-node4');
|
|
10
10
|
var path = require('path');
|
|
11
11
|
var mkdir = require('mkdirp');
|
|
12
12
|
|
|
@@ -84,19 +84,36 @@ var BundleAnalyzerPlugin = function () {
|
|
|
84
84
|
}
|
|
85
85
|
}, {
|
|
86
86
|
key: 'generateStatsFile',
|
|
87
|
-
value: function
|
|
88
|
-
var
|
|
87
|
+
value: function () {
|
|
88
|
+
var _ref = _asyncToGenerator(function* (stats) {
|
|
89
|
+
var statsFilepath = path.resolve(this.compiler.outputPath, this.opts.statsFilename);
|
|
90
|
+
mkdir.sync(path.dirname(statsFilepath));
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
yield bfj.write(statsFilepath, stats, {
|
|
94
|
+
promises: 'ignore',
|
|
95
|
+
buffers: 'ignore',
|
|
96
|
+
maps: 'ignore',
|
|
97
|
+
iterables: 'ignore',
|
|
98
|
+
circular: 'ignore'
|
|
99
|
+
});
|
|
89
100
|
|
|
90
|
-
|
|
101
|
+
this.logger.info(`${bold('Webpack Bundle Analyzer')} saved stats file to ${bold(statsFilepath)}`);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
this.logger.error(`${bold('Webpack Bundle Analyzer')} error saving stats file to ${bold(statsFilepath)}: ${error}`);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
91
106
|
|
|
92
|
-
|
|
107
|
+
function generateStatsFile(_x) {
|
|
108
|
+
return _ref.apply(this, arguments);
|
|
109
|
+
}
|
|
93
110
|
|
|
94
|
-
|
|
95
|
-
}
|
|
111
|
+
return generateStatsFile;
|
|
112
|
+
}()
|
|
96
113
|
}, {
|
|
97
114
|
key: 'startAnalyzerServer',
|
|
98
115
|
value: function () {
|
|
99
|
-
var
|
|
116
|
+
var _ref2 = _asyncToGenerator(function* (stats) {
|
|
100
117
|
if (this.server) {
|
|
101
118
|
(yield this.server).updateChartData(stats);
|
|
102
119
|
} else {
|
|
@@ -111,8 +128,8 @@ var BundleAnalyzerPlugin = function () {
|
|
|
111
128
|
}
|
|
112
129
|
});
|
|
113
130
|
|
|
114
|
-
function startAnalyzerServer(
|
|
115
|
-
return
|
|
131
|
+
function startAnalyzerServer(_x2) {
|
|
132
|
+
return _ref2.apply(this, arguments);
|
|
116
133
|
}
|
|
117
134
|
|
|
118
135
|
return startAnalyzerServer;
|
package/lib/parseUtils.js
CHANGED
|
@@ -119,7 +119,7 @@ function isArgumentArrayConcatContainingChunks(arg) {
|
|
|
119
119
|
function isModuleWrapper(node) {
|
|
120
120
|
return (
|
|
121
121
|
// It's an anonymous function expression that wraps module
|
|
122
|
-
node.type === 'FunctionExpression' && !node.id ||
|
|
122
|
+
(node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') && !node.id ||
|
|
123
123
|
// If `DedupePlugin` is used it can be an ID of duplicated module...
|
|
124
124
|
isModuleId(node) ||
|
|
125
125
|
// or an array of shape [<module_id>, ...args]
|
package/lib/viewer.js
CHANGED
|
@@ -57,6 +57,15 @@ var startServer = function () {
|
|
|
57
57
|
|
|
58
58
|
var wss = new WebSocket.Server({ server });
|
|
59
59
|
|
|
60
|
+
wss.on('connection', function (ws) {
|
|
61
|
+
ws.on('error', function (err) {
|
|
62
|
+
// Ignore network errors like `ECONNRESET`, `EPIPE`, etc.
|
|
63
|
+
if (err.errno) return;
|
|
64
|
+
|
|
65
|
+
logger.info(err.message);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
60
69
|
return {
|
|
61
70
|
ws: wss,
|
|
62
71
|
http: server,
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-bundle-analyzer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.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",
|
|
7
|
-
"homepage": "https://github.com/
|
|
8
|
-
"changelog": "https://github.com/
|
|
7
|
+
"homepage": "https://github.com/webpack-contrib/webpack-bundle-analyzer",
|
|
8
|
+
"changelog": "https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/CHANGELOG.md",
|
|
9
9
|
"bugs": {
|
|
10
|
-
"url": "https://github.com/
|
|
10
|
+
"url": "https://github.com/webpack-contrib/webpack-bundle-analyzer/issues"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "git+https://github.com/
|
|
14
|
+
"url": "git+https://github.com/webpack-contrib/webpack-bundle-analyzer.git"
|
|
15
15
|
},
|
|
16
16
|
"main": "lib/index.js",
|
|
17
17
|
"bin": "lib/bin/analyzer.js",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"build": "gulp build",
|
|
24
24
|
"npm-publish": "npm run lint && npm run build && npm test && npm publish",
|
|
25
25
|
"lint": "eslint --ext js,jsx .",
|
|
26
|
-
"test": "mocha --
|
|
27
|
-
"test-dev": "mocha --watch --
|
|
26
|
+
"test": "mocha --exit --require babel-core/register",
|
|
27
|
+
"test-dev": "mocha --watch --require babel-core/register"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"public",
|
|
@@ -33,47 +33,47 @@
|
|
|
33
33
|
"views"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"acorn": "^5.
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
36
|
+
"acorn": "^5.3.0",
|
|
37
|
+
"bfj-node4": "^5.2.0",
|
|
38
|
+
"chalk": "^2.3.0",
|
|
39
|
+
"commander": "^2.13.0",
|
|
40
|
+
"ejs": "^2.5.7",
|
|
41
|
+
"express": "^4.16.2",
|
|
42
|
+
"filesize": "^3.5.11",
|
|
43
|
+
"gzip-size": "^4.1.0",
|
|
43
44
|
"lodash": "^4.17.4",
|
|
44
45
|
"mkdirp": "^0.5.1",
|
|
45
46
|
"opener": "^1.4.3",
|
|
46
|
-
"ws": "^
|
|
47
|
+
"ws": "^4.0.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"babel-core": "6.
|
|
50
|
-
"babel-eslint": "
|
|
51
|
-
"babel-loader": "7.
|
|
50
|
+
"babel-core": "6.26.0",
|
|
51
|
+
"babel-eslint": "8.2.1",
|
|
52
|
+
"babel-loader": "7.1.2",
|
|
52
53
|
"babel-plugin-transform-class-properties": "6.24.1",
|
|
53
|
-
"babel-plugin-transform-object-rest-spread": "6.
|
|
54
|
+
"babel-plugin-transform-object-rest-spread": "6.26.0",
|
|
54
55
|
"babel-plugin-transform-react-jsx": "6.24.1",
|
|
55
|
-
"babel-preset-env": "1.
|
|
56
|
-
"chai": "
|
|
57
|
-
"chai-subset": "1.
|
|
56
|
+
"babel-preset-env": "1.6.1",
|
|
57
|
+
"chai": "4.1.2",
|
|
58
|
+
"chai-subset": "1.6.0",
|
|
58
59
|
"classnames": "2.2.5",
|
|
59
|
-
"css-loader": "0.28.
|
|
60
|
-
"del": "
|
|
61
|
-
"eslint": "
|
|
62
|
-
"eslint-
|
|
60
|
+
"css-loader": "0.28.9",
|
|
61
|
+
"del": "3.0.0",
|
|
62
|
+
"eslint": "4.16.0",
|
|
63
|
+
"eslint-config-th0r": "1.0.0",
|
|
64
|
+
"eslint-config-th0r-react": "1.0.0",
|
|
65
|
+
"eslint-plugin-react": "7.6.1",
|
|
63
66
|
"exports-loader": "0.6.4",
|
|
64
|
-
"gulp": "
|
|
65
|
-
"gulp-babel": "
|
|
66
|
-
"
|
|
67
|
-
"gulp-util": "3.0.8",
|
|
68
|
-
"gulp-watch": "4.3.11",
|
|
69
|
-
"mocha": "3.3.0",
|
|
67
|
+
"gulp": "4.0.0",
|
|
68
|
+
"gulp-babel": "7.0.1",
|
|
69
|
+
"mocha": "5.0.0",
|
|
70
70
|
"nightmare": "2.10.0",
|
|
71
|
-
"preact": "8.
|
|
72
|
-
"sinon": "2.2
|
|
71
|
+
"preact": "8.2.7",
|
|
72
|
+
"sinon": "4.2.2",
|
|
73
73
|
"stream-combiner2": "1.1.1",
|
|
74
|
-
"style-loader": "0.
|
|
75
|
-
"webpack": "
|
|
76
|
-
"webpack-dev-server": "2.
|
|
74
|
+
"style-loader": "0.20.1",
|
|
75
|
+
"webpack": "3.10.0",
|
|
76
|
+
"webpack-dev-server": "2.11.1"
|
|
77
77
|
},
|
|
78
78
|
"keywords": [
|
|
79
79
|
"webpack",
|