webpack-bundle-analyzer 2.9.2 → 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 CHANGED
@@ -14,6 +14,16 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
14
14
 
15
15
  <!-- Add changelog entries for new changes under this section -->
16
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
+
17
27
  ## 2.9.2
18
28
 
19
29
  * **Bug Fix**
@@ -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 fs = require('fs');
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 generateStatsFile(stats) {
88
- var statsFilepath = path.resolve(this.compiler.outputPath, this.opts.statsFilename);
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
- mkdir.sync(path.dirname(statsFilepath));
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
- fs.writeFileSync(statsFilepath, JSON.stringify(stats, null, 2));
107
+ function generateStatsFile(_x) {
108
+ return _ref.apply(this, arguments);
109
+ }
93
110
 
94
- this.logger.info(`${bold('Webpack Bundle Analyzer')} saved stats file to ${bold(statsFilepath)}`);
95
- }
111
+ return generateStatsFile;
112
+ }()
96
113
  }, {
97
114
  key: 'startAnalyzerServer',
98
115
  value: function () {
99
- var _ref = _asyncToGenerator(function* (stats) {
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(_x) {
115
- return _ref.apply(this, arguments);
131
+ function startAnalyzerServer(_x2) {
132
+ return _ref2.apply(this, arguments);
116
133
  }
117
134
 
118
135
  return startAnalyzerServer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-bundle-analyzer",
3
- "version": "2.9.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",
@@ -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 --compilers js:babel-core/register",
27
- "test-dev": "mocha --watch --compilers js:babel-core/register"
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.1.1",
37
- "chalk": "^1.1.3",
38
- "commander": "^2.9.0",
39
- "ejs": "^2.5.6",
40
- "express": "^4.15.2",
41
- "filesize": "^3.5.9",
42
- "gzip-size": "^3.0.0",
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
47
  "ws": "^4.0.0"
47
48
  },
48
49
  "devDependencies": {
49
- "babel-core": "6.24.1",
50
- "babel-eslint": "7.2.3",
51
- "babel-loader": "7.0.0",
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.23.0",
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.4.0",
56
- "chai": "3.5.0",
57
- "chai-subset": "1.5.0",
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.1",
60
- "del": "2.2.2",
61
- "eslint": "3.19.0",
62
- "eslint-plugin-react": "7.0.0",
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": "3.9.1",
65
- "gulp-babel": "6.1.2",
66
- "gulp-plumber": "1.1.0",
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.1.0",
72
- "sinon": "2.2.0",
71
+ "preact": "8.2.7",
72
+ "sinon": "4.2.2",
73
73
  "stream-combiner2": "1.1.1",
74
- "style-loader": "0.17.0",
75
- "webpack": "2.5.1",
76
- "webpack-dev-server": "2.4.5"
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",