Socket
Socket
Sign inDemoInstall

webpack-bundle-analyzer

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-bundle-analyzer - npm Package Compare versions

Comparing version 4.9.1 to 4.10.0

8

CHANGELOG.md

@@ -15,2 +15,10 @@ # Changelog

## 4.10.0
* **Improvement**
* Allows filtering the list of entrypoints ([#624](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/624) by [@chriskrogh](https://github.com/chriskrogh))
* **Internal**
* Make module much slimmer by replacing all `lodash.*` packages ([#612](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/612)) by [@sukkaw](https://github.com/sukkaw).
## 4.9.1

@@ -17,0 +25,0 @@

64

lib/analyzer.js

@@ -7,10 +7,2 @@ "use strict";

const pullAll = require('lodash.pullall');
const invokeMap = require('lodash.invokemap');
const uniqBy = require('lodash.uniqby');
const flatten = require('lodash.flatten');
const gzipSize = require('gzip-size');

@@ -132,3 +124,3 @@

const assetModules = modules.filter(statModule => assetHasModule(statAsset, statModule)); // Adding parsed sources
let assetModules = modules.filter(statModule => assetHasModule(statAsset, statModule)); // Adding parsed sources

@@ -156,3 +148,3 @@ if (parsedModules) {

// If there are multiple entry points we move all of them under synthetic concatenated module.
pullAll(assetModules, unparsedEntryModules);
assetModules = assetModules.filter(mod => !unparsedEntryModules.includes(mod));
assetModules.unshift({

@@ -187,3 +179,3 @@ identifier: './entry modules',

gzipSize: asset.gzipSize,
groups: invokeMap(asset.tree.children, 'toChartData'),
groups: Object.values(asset.tree.children).map(i => i.toChartData()),
isInitialByEntrypoint: (_chunkToInitialByEntr = chunkToInitialByEntrypoint[filename]) !== null && _chunkToInitialByEntr !== void 0 ? _chunkToInitialByEntr : {}

@@ -207,4 +199,16 @@ };

return uniqBy(flatten((((_bundleStats$chunks = bundleStats.chunks) === null || _bundleStats$chunks === void 0 ? void 0 : _bundleStats$chunks.map(chunk => chunk.modules)) || []).concat(bundleStats.modules).filter(Boolean)), 'id' // Filtering out Webpack's runtime modules as they don't have ids and can't be parsed (introduced in Webpack 5)
).filter(m => !isRuntimeModule(m));
const seenIds = new Set();
return flatten((((_bundleStats$chunks = bundleStats.chunks) === null || _bundleStats$chunks === void 0 ? void 0 : _bundleStats$chunks.map(chunk => chunk.modules)) || []).concat(bundleStats.modules).filter(Boolean)).filter(mod => {
// Filtering out Webpack's runtime modules as they don't have ids and can't be parsed (introduced in Webpack 5)
if (isRuntimeModule(mod)) {
return false;
}
if (seenIds.has(mod.id)) {
return false;
}
seenIds.add(mod.id);
return true;
});
}

@@ -249,2 +253,34 @@

;
;
/**
* arr-flatten <https://github.com/jonschlinkert/arr-flatten>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*
* Modified by Sukka <https://skk.moe>
*
* Replace recursively flatten with one-level deep flatten to match lodash.flatten
*
* TODO: replace with Array.prototype.flat once Node.js 10 support is dropped
*/
function flatten(arr) {
if (!arr) return [];
const len = arr.length;
if (!len) return [];
let cur;
const res = [];
for (let i = 0; i < len; i++) {
cur = arr[i];
if (Array.isArray(cur)) {
res.push(...cur);
} else {
res.push(cur);
}
}
return res;
}

@@ -8,3 +8,5 @@ "use strict";

const escape = require('lodash.escape');
const {
escape
} = require('html-escaper');

@@ -11,0 +13,0 @@ const projectRoot = path.resolve(__dirname, '..');

@@ -8,4 +8,2 @@ "use strict";

var _lodash = _interopRequireDefault(require("lodash.invokemap"));
var _Node = _interopRequireDefault(require("./Node"));

@@ -121,3 +119,3 @@

statSize: this.size,
groups: (0, _lodash.default)(this.children, 'toChartData')
groups: Object.values(this.children).map(child => child.toChartData())
};

@@ -124,0 +122,0 @@ }

@@ -8,4 +8,2 @@ "use strict";

var _lodash = _interopRequireDefault(require("lodash.invokemap"));
var _Module = _interopRequireDefault(require("./Module"));

@@ -92,3 +90,7 @@

mergeNestedFolders() {
(0, _lodash.default)(this.children, 'mergeNestedFolders');
Object.values(this.children).forEach(child => {
if (child.mergeNestedFolders) {
child.mergeNestedFolders();
}
});
}

@@ -99,3 +101,3 @@

concatenated: true,
groups: (0, _lodash.default)(this.children, 'toChartData')
groups: Object.values(this.children).map(child => child.toChartData())
};

@@ -102,0 +104,0 @@ }

{
"name": "webpack-bundle-analyzer",
"version": "4.9.1",
"version": "4.10.0",
"description": "Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap",

@@ -21,2 +21,3 @@ "author": "Yury Grunin <grunin.ya@ya.ru>",

},
"packageManager": "npm@6.14.8",
"scripts": {

@@ -40,11 +41,7 @@ "start": "gulp watch",

"commander": "^7.2.0",
"debounce": "^1.2.1",
"escape-string-regexp": "^4.0.0",
"gzip-size": "^6.0.0",
"html-escaper": "^2.0.2",
"is-plain-object": "^5.0.0",
"lodash.debounce": "^4.0.8",
"lodash.escape": "^4.0.1",
"lodash.flatten": "^4.4.0",
"lodash.invokemap": "^4.6.0",
"lodash.pullall": "^4.2.0",
"lodash.uniqby": "^4.7.0",
"opener": "^1.5.2",

@@ -51,0 +48,0 @@ "picocolors": "^1.0.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc