New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webpack-bundle-stats-plugin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-bundle-stats-plugin - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

17

lib/getStatsFromCompilation.js

@@ -8,10 +8,18 @@ "use strict";

webpackBundleStatsPluginVersion: version,
assets: getAssets(compilation),
chunkGroups: getChunkGroups(compilation),
chunks: getChunks(compilation),
modules: getModules(compilation),
};
}
exports.getStatsFromCompilation = getStatsFromCompilation;
function getAssets(compilation) {
const assets = {};
for (let assetName of compilation.assetsInfo.keys()) {
assets[assetName] = { size: compilation.assetsInfo.get(assetName).size };
}
return assets;
}
function getChunkGroups(compilation) {
return compilation.chunkGroups.map(cg => ({
chunkGroupType: cg.constructor.name,
id: cg.id,

@@ -28,10 +36,5 @@ name: cg.name || undefined,

files: [...c.files],
modules: compilation.chunkGraph
.getChunkModules(c)
.map(m => m.readableIdentifier(compilation.requestShortener)),
modules: compilation.chunkGraph.getChunkModules(c).map(m => getModule(m, compilation)),
}));
}
function getModules(compilation) {
return [...compilation.modules].map(m => getModule(m, compilation));
}
function getModule(m, compilation) {

@@ -38,0 +41,0 @@ var _a;

export interface BundleStats {
webpackBundleStatsPluginVersion: string;
assets: Record<string, Asset>;
chunkGroups: ChunkGroup[];
chunks: Chunk[];
modules: Module[];
}
export interface Asset {
size: number;
}
export interface ChunkGroup {
chunkGroupType: string;
id: string;

@@ -17,3 +21,3 @@ name?: string;

files: string[];
modules: string[];
modules: Module[];
}

@@ -20,0 +24,0 @@ export declare type ChunkId = string | number;

{
"name": "webpack-bundle-stats-plugin",
"version": "0.2.1",
"version": "0.3.0",
"description": "Export internal bundling details from Webpack",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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