Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
28
node_modules/webpack/lib/ids/OccurrenceModuleIdsPlugin.js
generated
vendored
28
node_modules/webpack/lib/ids/OccurrenceModuleIdsPlugin.js
generated
vendored
@@ -35,6 +35,7 @@ class OccurrenceModuleIdsPlugin {
|
||||
*/
|
||||
constructor(options = {}) {
|
||||
validate(options);
|
||||
/** @type {OccurrenceModuleIdsPluginOptions} */
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
@@ -44,7 +45,6 @@ class OccurrenceModuleIdsPlugin {
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(compiler) {
|
||||
const prioritiseInitial = this.options.prioritiseInitial;
|
||||
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
||||
const moduleGraph = compilation.moduleGraph;
|
||||
|
||||
@@ -54,10 +54,14 @@ class OccurrenceModuleIdsPlugin {
|
||||
const [usedIds, modulesInOccurrenceOrder] =
|
||||
getUsedModuleIdsAndModules(compilation);
|
||||
|
||||
/** @type {Map<Module, number>} */
|
||||
const occursInInitialChunksMap = new Map();
|
||||
/** @type {Map<Module, number>} */
|
||||
const occursInAllChunksMap = new Map();
|
||||
|
||||
/** @type {Map<Module, number>} */
|
||||
const initialChunkChunkMap = new Map();
|
||||
/** @type {Map<Module, number>} */
|
||||
const entryCountMap = new Map();
|
||||
for (const m of modulesInOccurrenceOrder) {
|
||||
let initial = 0;
|
||||
@@ -111,12 +115,12 @@ class OccurrenceModuleIdsPlugin {
|
||||
return sum;
|
||||
};
|
||||
|
||||
if (prioritiseInitial) {
|
||||
if (this.options.prioritiseInitial) {
|
||||
for (const m of modulesInOccurrenceOrder) {
|
||||
const result =
|
||||
countOccursInEntry(m) +
|
||||
initialChunkChunkMap.get(m) +
|
||||
entryCountMap.get(m);
|
||||
/** @type {number} */ (initialChunkChunkMap.get(m)) +
|
||||
/** @type {number} */ (entryCountMap.get(m));
|
||||
occursInInitialChunksMap.set(m, result);
|
||||
}
|
||||
}
|
||||
@@ -125,7 +129,7 @@ class OccurrenceModuleIdsPlugin {
|
||||
const result =
|
||||
countOccurs(m) +
|
||||
chunkGraph.getNumberOfModuleChunks(m) +
|
||||
entryCountMap.get(m);
|
||||
/** @type {number} */ (entryCountMap.get(m));
|
||||
occursInAllChunksMap.set(m, result);
|
||||
}
|
||||
|
||||
@@ -134,14 +138,18 @@ class OccurrenceModuleIdsPlugin {
|
||||
);
|
||||
|
||||
modulesInOccurrenceOrder.sort((a, b) => {
|
||||
if (prioritiseInitial) {
|
||||
const aEntryOccurs = occursInInitialChunksMap.get(a);
|
||||
const bEntryOccurs = occursInInitialChunksMap.get(b);
|
||||
if (this.options.prioritiseInitial) {
|
||||
const aEntryOccurs =
|
||||
/** @type {number} */
|
||||
(occursInInitialChunksMap.get(a));
|
||||
const bEntryOccurs =
|
||||
/** @type {number} */
|
||||
(occursInInitialChunksMap.get(b));
|
||||
if (aEntryOccurs > bEntryOccurs) return -1;
|
||||
if (aEntryOccurs < bEntryOccurs) return 1;
|
||||
}
|
||||
const aOccurs = occursInAllChunksMap.get(a);
|
||||
const bOccurs = occursInAllChunksMap.get(b);
|
||||
const aOccurs = /** @type {number} */ (occursInAllChunksMap.get(a));
|
||||
const bOccurs = /** @type {number} */ (occursInAllChunksMap.get(b));
|
||||
if (aOccurs > bOccurs) return -1;
|
||||
if (aOccurs < bOccurs) return 1;
|
||||
return naturalCompare(a, b);
|
||||
|
||||
Reference in New Issue
Block a user