webpack-bundle-diff
Advanced tools
Comparing version 1.2.0-alpha.2 to 1.2.0-alpha.3
@@ -8,3 +8,5 @@ "use strict"; | ||
// Process each named chunk group | ||
for (let chunkGroupName of Object.keys(stats.namedChunkGroups)) { | ||
for (let chunkGroupName of stats.namedChunkGroups instanceof Map | ||
? stats.namedChunkGroups.keys() | ||
: Object.keys(stats.namedChunkGroups)) { | ||
const chunkGroup = stats.namedChunkGroups instanceof Map | ||
@@ -17,5 +19,3 @@ ? stats.namedChunkGroups.get(chunkGroupName) | ||
const chunkGroupAssets = 'pushChunk' in chunkGroup | ||
? chunkGroup | ||
.getFiles() | ||
.map((assetName) => ({ | ||
? chunkGroup.getFiles().map((assetName) => ({ | ||
name: assetName, | ||
@@ -22,0 +22,0 @@ size: stats.getAsset(assetName).info.size, |
@@ -38,3 +38,7 @@ "use strict"; | ||
// Precalculate named chunk groups since they are the same for all submodules | ||
const moduleChunks = 'hasReasons' in module ? module.getChunks().map(({ id }) => id) : module.chunks; | ||
const moduleChunks = 'hasReasons' in module | ||
? compilation.chunkGraph | ||
.getModuleChunks(module) | ||
.map(chunk => chunk.id) | ||
: module.chunks; | ||
const namedChunkGroups = ncgLookup.getNamedChunkGroups(moduleChunks); | ||
@@ -41,0 +45,0 @@ if (!module.modules) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const getModuleName_1 = require("../../../util/getModuleName"); | ||
const getId_1 = require("../../../util/getId"); | ||
// Helper class to map module IDs to module names | ||
@@ -11,4 +12,4 @@ class ModuleIdToNameMap { | ||
// If the module contains multiple hoisted modules, assume the first one is the primary module | ||
let name = (0, getModuleName_1.getModuleName)(module, stats); | ||
this.map.set(module.id, name); | ||
const name = (0, getModuleName_1.getModuleName)(module, stats); | ||
this.map.set((0, getId_1.getId)(module, stats), name); | ||
} | ||
@@ -15,0 +16,0 @@ } |
{ | ||
"name": "webpack-bundle-diff", | ||
"version": "1.2.0-alpha.2", | ||
"version": "1.2.0-alpha.3", | ||
"description": "Understand changes in webpack bundle size", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53279
68
990