@statoscope/webpack-model
Advanced tools
Comparing version 5.9.0 to 5.11.0
@@ -186,2 +186,15 @@ "use strict"; | ||
} | ||
function mergeModules(from, to) { | ||
var _a, _b, _c, _d; | ||
const chunks = new Set([...((_a = to.chunks) !== null && _a !== void 0 ? _a : []), ...((_b = from.chunks) !== null && _b !== void 0 ? _b : [])]); | ||
to.chunks = [...chunks]; | ||
to.reasons = [...((_c = to.reasons) !== null && _c !== void 0 ? _c : []), ...((_d = from.reasons) !== null && _d !== void 0 ? _d : [])].reduce((all, current) => { | ||
if (!all.find((r) => r.moduleIdentifier === current.moduleIdentifier && | ||
r.type === current.type && | ||
r.loc === current.loc)) { | ||
all.push(current); | ||
} | ||
return all; | ||
}, []); | ||
} | ||
function makeModuleResolver(compilation) { | ||
@@ -197,5 +210,4 @@ const modules = [...compilation.modules]; | ||
else { | ||
const chunks = new Set([...resolved.chunks, ...chunk.modules[+ix].chunks]); | ||
resolved.chunks = [...chunks]; | ||
chunk.modules[+ix] = resolved; | ||
mergeModules(module, resolved); | ||
} | ||
@@ -312,3 +324,2 @@ } | ||
function prepareChunk(chunk, resolvers) { | ||
var _a; | ||
const { resolveModule, resolveAsset, resolveChunk } = resolvers; | ||
@@ -328,7 +339,4 @@ // @ts-ignore | ||
if (resolved) { | ||
const chunks = new Set([...resolved.chunks, ...((_a = chunk.modules[+i].chunks) !== null && _a !== void 0 ? _a : [])]); | ||
resolved.chunks = [...chunks].map((chunk) => typeof chunk === 'string' || typeof chunk === 'number' | ||
? resolveChunk(chunk) | ||
: chunk); | ||
chunk.modules[+i] = resolved; | ||
mergeModules(module, resolved); | ||
} | ||
@@ -335,0 +343,0 @@ prepareModule(module, resolvers); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function handleModule(module, modulesData) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
let resolvedId = modulesData.idToIxMap.get(module.identifier); | ||
@@ -16,2 +16,13 @@ if (!resolvedId) { | ||
]; | ||
resolvedModule.reasons = [ | ||
...((_c = resolvedModule.reasons) !== null && _c !== void 0 ? _c : []), | ||
...((_d = module.reasons) !== null && _d !== void 0 ? _d : []), | ||
].reduce((all, current) => { | ||
if (!all.find((r) => r.moduleIdentifier === current.moduleIdentifier && | ||
r.type === current.type && | ||
r.loc === current.loc)) { | ||
all.push(current); | ||
} | ||
return all; | ||
}, []); | ||
} | ||
@@ -18,0 +29,0 @@ return resolvedId; |
{ | ||
"name": "@statoscope/webpack-model", | ||
"version": "5.9.0", | ||
"version": "5.11.0", | ||
"description": "This package contains helpers to process webpack stats", | ||
@@ -36,3 +36,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "f8e8a9cd721828a4bc53a2f808441d81e5fdbf84" | ||
"gitHead": "08e84826c7527e36ba838796609daf1b4fbb6324" | ||
} |
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
72945
1767