Socket
Socket
Sign inDemoInstall

webpack

Package Overview
Dependencies
76
Maintainers
4
Versions
832
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.88.0 to 5.88.1

3

lib/BannerPlugin.js

@@ -14,2 +14,3 @@ /*

/** @typedef {import("../declarations/plugins/BannerPlugin").BannerFunction} BannerFunction */
/** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginArgument} BannerPluginArgument */

@@ -64,3 +65,3 @@ /** @typedef {import("../declarations/plugins/BannerPlugin").BannerPluginOptions} BannerPluginOptions */

? getBanner
: data => wrapComment(getBanner(data));
: /** @type {BannerFunction} */ data => wrapComment(getBanner(data));
} else {

@@ -67,0 +68,0 @@ const banner = this.options.raw

@@ -19,2 +19,3 @@ /*

/** @typedef {import("./Dependency")} Dependency */
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("./Entrypoint")} Entrypoint */

@@ -43,11 +44,11 @@ /** @typedef {import("./Module")} Module */

* @property {RuntimeSpec} runtime the runtimes
* @property {ModuleSetPlus} minAvailableModules current minimal set of modules available at this point
* @property {boolean} minAvailableModulesOwned true, if minAvailableModules is owned and can be modified
* @property {ModuleSetPlus | undefined} minAvailableModules current minimal set of modules available at this point
* @property {boolean | undefined} minAvailableModulesOwned true, if minAvailableModules is owned and can be modified
* @property {ModuleSetPlus[]} availableModulesToBeMerged enqueued updates to the minimal set of available modules
* @property {Set<Module>=} skippedItems modules that were skipped because module is already available in parent chunks (need to reconsider when minAvailableModules is shrinking)
* @property {Set<[Module, ConnectionState]>=} skippedModuleConnections referenced modules that where skipped because they were not active in this runtime
* @property {ModuleSetPlus} resultingAvailableModules set of modules available including modules from this chunk group
* @property {Set<ChunkGroupInfo>} children set of children chunk groups, that will be revisited when availableModules shrink
* @property {Set<ChunkGroupInfo>} availableSources set of chunk groups that are the source for minAvailableModules
* @property {Set<ChunkGroupInfo>} availableChildren set of chunk groups which depend on the this chunk group as availableSource
* @property {ModuleSetPlus | undefined} resultingAvailableModules set of modules available including modules from this chunk group
* @property {Set<ChunkGroupInfo> | undefined} children set of children chunk groups, that will be revisited when availableModules shrink
* @property {Set<ChunkGroupInfo> | undefined} availableSources set of chunk groups that are the source for minAvailableModules
* @property {Set<ChunkGroupInfo> | undefined} availableChildren set of chunk groups which depend on the this chunk group as availableSource
* @property {number} preOrderIndex next pre order index

@@ -204,2 +205,3 @@ * @property {number} postOrderIndex next post order index

let blockModulesMapRuntime = false;
/** @type {Map<DependenciesBlock, (Module | ConnectionState)[]>} */
let blockModulesMap;

@@ -245,3 +247,3 @@

logger.timeAggregate("visitModules: prepare");
return blockModules;
return /** @type {(Module | ConnectionState)[]} */ (blockModules);
}

@@ -297,3 +299,3 @@ };

compilation,
chunkGroup.name,
/** @type {string} */ (chunkGroup.name),
chunkGroup.options

@@ -360,3 +362,5 @@ );

for (const parent of chunkGroup.parentsIterable) {
const parentChunkGroupInfo = chunkGroupInfoMap.get(parent);
const parentChunkGroupInfo =
/** @type {ChunkGroupInfo} */
(chunkGroupInfoMap.get(parent));
chunkGroupInfo.availableSources.add(parentChunkGroupInfo);

@@ -408,5 +412,5 @@ if (parentChunkGroupInfo.availableChildren === undefined) {

let cgi = blockChunkGroups.get(b);
/** @type {ChunkGroup} */
/** @type {ChunkGroup | undefined} */
let c;
/** @type {Entrypoint} */
/** @type {Entrypoint | undefined} */
let entrypoint;

@@ -417,3 +421,3 @@ const entryOptions = b.groupOptions && b.groupOptions.entryOptions;

if (entryOptions) {
cgi = namedAsyncEntrypoints.get(chunkName);
cgi = namedAsyncEntrypoints.get(/** @type {string} */ (chunkName));
if (!cgi) {

@@ -516,3 +520,7 @@ entrypoint = compilation.addAsyncEntrypoint(

compilation.errors.push(
new AsyncDependencyToInitialChunkError(chunkName, module, b.loc)
new AsyncDependencyToInitialChunkError(
/** @type {string} */ (chunkName),
module,
b.loc
)
);

@@ -527,3 +535,3 @@ c = chunkGroup;

}
blockChunkGroups.set(b, cgi);
blockChunkGroups.set(b, /** @type {ChunkGroupInfo} */ (cgi));
} else if (entryOptions) {

@@ -549,3 +557,3 @@ entrypoint = /** @type {Entrypoint} */ (cgi.chunkGroup);

}
connectList.add(cgi);
connectList.add(/** @type {ChunkGroupInfo} */ (cgi));

@@ -561,3 +569,3 @@ // TODO check if this really need to be done for each traversal

chunkGroup: c,
chunkGroupInfo: cgi
chunkGroupInfo: /** @type {ChunkGroupInfo} */ (cgi)
});

@@ -705,3 +713,3 @@ } else if (entrypoint !== undefined) {

statProcessedQueueItems++;
const queueItem = queue.pop();
const queueItem = /** @type {QueueItem} */ (queue.pop());
module = queueItem.module;

@@ -1103,3 +1111,5 @@ block = queueItem.block;

for (const info of chunkGroupsForCombining) {
for (const source of info.availableSources) {
for (const source of /** @type {Set<ChunkGroupInfo>} */ (
info.availableSources
)) {
if (!source.minAvailableModules) {

@@ -1123,3 +1133,5 @@ chunkGroupsForCombining.delete(info);

// combine minAvailableModules from all resultingAvailableModules
for (const source of info.availableSources) {
for (const source of /** @type {Set<ChunkGroupInfo>} */ (
info.availableSources
)) {
const resultingAvailableModules =

@@ -1144,3 +1156,5 @@ calculateResultingAvailableModules(source);

if (info.skippedItems !== undefined) {
const { minAvailableModules } = info;
const minAvailableModules =
/** @type {ModuleSetPlus} */
(info.minAvailableModules);
for (const module of info.skippedItems) {

@@ -1166,3 +1180,5 @@ if (

if (info.skippedModuleConnections !== undefined) {
const { minAvailableModules } = info;
const minAvailableModules =
/** @type {ModuleSetPlus} */
(info.minAvailableModules);
for (const entry of info.skippedModuleConnections) {

@@ -1169,0 +1185,0 @@ const [module, activeState] = entry;

@@ -23,2 +23,3 @@ /*

/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../FileSystemInfo").ResolveBuildDependenciesResult} ResolveBuildDependenciesResult */
/** @typedef {import("../FileSystemInfo").Snapshot} Snapshot */

@@ -30,2 +31,4 @@ /** @typedef {import("../logging/Logger").Logger} Logger */

/** @typedef {Map<string, string | false>} ResolveResults */
class PackContainer {

@@ -37,3 +40,3 @@ /**

* @param {Set<string>} buildDependencies list of all unresolved build dependencies captured
* @param {Map<string, string | false>} resolveResults result of the resolved build dependencies
* @param {ResolveResults} resolveResults result of the resolved build dependencies
* @param {Snapshot} resolveBuildDependenciesSnapshot snapshot of the dependencies of the build dependencies resolving

@@ -983,2 +986,6 @@ */

/**
* @param {Buffer} buf buffer
* @returns {Buffer} buffer that can be collected
*/
const allowCollectingMemory = buf => {

@@ -1003,6 +1010,6 @@ const wasted = buf.buffer.byteLength - buf.byteLength;

* @param {number} options.maxAge max age of cache items
* @param {boolean} options.profile track and log detailed timing information for individual cache items
* @param {boolean} options.allowCollectingMemory allow to collect unused memory created during deserialization
* @param {false | "gzip" | "brotli"} options.compression compression used
* @param {boolean} options.readonly disable storing cache into filesystem
* @param {boolean | undefined} options.profile track and log detailed timing information for individual cache items
* @param {boolean | undefined} options.allowCollectingMemory allow to collect unused memory created during deserialization
* @param {false | "gzip" | "brotli" | undefined} options.compression compression used
* @param {boolean | undefined} options.readonly disable storing cache into filesystem
*/

@@ -1056,3 +1063,3 @@ constructor({

this.resolveBuildDependenciesSnapshot = undefined;
/** @type {Map<string, string | false> | undefined} */
/** @type {ResolveResults | undefined} */
this.resolveResults = undefined;

@@ -1089,3 +1096,3 @@ /** @type {Snapshot | undefined} */

let resolveBuildDependenciesSnapshot;
/** @type {Map<string, string | false>} */
/** @type {ResolveResults | undefined} */
let resolveResults;

@@ -1274,2 +1281,5 @@ logger.time("restore cache container");

/**
* @param {LazySet<string>} dependencies dependencies to store
*/
storeBuildDependencies(dependencies) {

@@ -1320,3 +1330,3 @@ if (this.readonly) return;

resolveDependencies
} = result;
} = /** @type {ResolveBuildDependenciesResult} */ (result);
if (this.resolveResults) {

@@ -1416,3 +1426,3 @@ for (const [key, value] of resolveResults) {

this.version,
this.buildSnapshot,
/** @type {Snapshot} */ (this.buildSnapshot),
updatedBuildDependencies,

@@ -1419,0 +1429,0 @@ this.resolveResults,

@@ -211,3 +211,3 @@ /*

this.outputPath = "";
/** @type {Watching} */
/** @type {Watching | undefined} */
this.watching = undefined;

@@ -234,11 +234,11 @@

/** @type {ReadonlySet<string>} */
/** @type {ReadonlySet<string> | undefined} */
this.modifiedFiles = undefined;
/** @type {ReadonlySet<string>} */
/** @type {ReadonlySet<string> | undefined} */
this.removedFiles = undefined;
/** @type {ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>} */
/** @type {ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null> | undefined} */
this.fileTimestamps = undefined;
/** @type {ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>} */
/** @type {ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null> | undefined} */
this.contextTimestamps = undefined;
/** @type {number} */
/** @type {number | undefined} */
this.fsStartTime = undefined;

@@ -245,0 +245,0 @@

@@ -18,3 +18,6 @@ /*

/** @typedef {import("estree").AssignmentProperty} AssignmentProperty */
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("estree").Identifier} Identifier */
/** @typedef {import("estree").Pattern} Pattern */
/** @typedef {import("estree").SourceLocation} SourceLocation */

@@ -28,6 +31,10 @@ /** @typedef {import("estree").Statement} Statement */

/**
* @param {Set<string>} declarations set of declarations
* @param {Identifier | Pattern} pattern pattern to collect declarations from
*/
const collectDeclaration = (declarations, pattern) => {
const stack = [pattern];
while (stack.length > 0) {
const node = stack.pop();
const node = /** @type {Pattern} */ (stack.pop());
switch (node.type) {

@@ -49,3 +56,3 @@ case "Identifier":

for (const property of node.properties) {
stack.push(property.value);
stack.push(/** @type {AssignmentProperty} */ (property).value);
}

@@ -60,4 +67,10 @@ break;

/**
* @param {Statement} branch branch to get hoisted declarations from
* @param {boolean} includeFunctionDeclarations whether to include function declarations
* @returns {Array<string>} hoisted declarations
*/
const getHoistedDeclarations = (branch, includeFunctionDeclarations) => {
const declarations = new Set();
/** @type {Array<TODO | null | undefined>} */
const stack = [branch];

@@ -110,3 +123,3 @@ while (stack.length > 0) {

if (includeFunctionDeclarations) {
collectDeclaration(declarations, node.id);
collectDeclaration(declarations, /** @type {Identifier} */ (node.id));
}

@@ -113,0 +126,0 @@ break;

@@ -30,3 +30,3 @@ /*

* @param {DependencyConstructor} dependency Constructor of Dependency
* @returns {DependencyTemplate} template for this dependency
* @returns {DependencyTemplate | undefined} template for this dependency
*/

@@ -33,0 +33,0 @@ get(dependency) {

@@ -1367,3 +1367,7 @@ /*

if (!t.export !== !target.export) return undefined;
if (target.export && !equals(t.export, target.export)) return undefined;
if (
target.export &&
!equals(/** @type {ArrayLike<string>} */ (t.export), target.export)
)
return undefined;
result = values.next();

@@ -1370,0 +1374,0 @@ }

@@ -48,2 +48,6 @@ /*

class Generator {
/**
* @param {Record<string, Generator>} map map of types
* @returns {ByTypeGenerator} generator by type
*/
static byType(map) {

@@ -110,2 +114,5 @@ return new ByTypeGenerator(map);

class ByTypeGenerator extends Generator {
/**
* @param {Record<string, Generator>} map map of types
*/
constructor(map) {

@@ -112,0 +119,0 @@ super();

@@ -63,2 +63,7 @@ /*

/**
* @param {Module} module a module
* @param {string} code the code
* @returns {string} generated code for the stack
*/
const printGeneratedCodeForStack = (module, code) => {

@@ -68,6 +73,14 @@ const lines = code.split("\n");

return `\n\nGenerated code for ${module.identifier()}\n${lines
.map((line, i, lines) => {
const iStr = `${i + 1}`;
return `${" ".repeat(n - iStr.length)}${iStr} | ${line}`;
})
.map(
/**
* @param {string} line the line
* @param {number} i the index
* @param {string[]} lines the lines
* @returns {string} the line with line number
*/
(line, i, lines) => {
const iStr = `${i + 1}`;
return `${" ".repeat(n - iStr.length)}${iStr} | ${line}`;
}
)
.join("\n")}`;

@@ -448,3 +461,6 @@ };

} catch (e) {
e.stack += printGeneratedCodeForStack(options.module, code);
e.stack += printGeneratedCodeForStack(
options.module,
/** @type {string} */ (code)
);
throw e;

@@ -1013,2 +1029,5 @@ }

/**
* @type {{startup: string[], beforeStartup: string[], header: string[], afterStartup: string[], allowInlineStartup: boolean}}
*/
const result = {

@@ -1015,0 +1034,0 @@ header: [],

@@ -71,4 +71,4 @@ /*

return {
name: /** @type {string=} */ (name),
amdContainer: /** @type {string=} */ (amdContainer)
name: /** @type {string} */ (name),
amdContainer: /** @type {string} */ (amdContainer)
};

@@ -75,0 +75,0 @@ }

@@ -20,2 +20,3 @@ /*

/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Compilation").ChunkHashContext} ChunkHashContext */

@@ -63,2 +64,3 @@ /** @typedef {import("../Compiler")} Compiler */

// all properties printed so far (excluding base)
/** @type {string[] | undefined} */
let propsSoFar;

@@ -147,3 +149,3 @@

return {
name: /** @type {string|string[]=} */ (name),
name: /** @type {string | string[]} */ (name),
export: library.export

@@ -179,2 +181,6 @@ };

/**
* @param {Compilation} compilation the compilation
* @returns {string[]} the prefix
*/
_getPrefix(compilation) {

@@ -186,2 +192,8 @@ return this.prefix === "global"

/**
* @param {AssignLibraryPluginParsed} options the library options
* @param {Chunk} chunk the chunk
* @param {Compilation} compilation the compilation
* @returns {Array<string>} the resolved full name
*/
_getResolvedFullName(options, chunk, compilation) {

@@ -188,0 +200,0 @@ const prefix = this._getPrefix(compilation);

@@ -15,2 +15,6 @@ /*

/**
* @param {Compiler} compiler the compiler instance
* @returns {Set<LibraryType>} enabled types
*/
const getEnabledTypes = compiler => {

@@ -17,0 +21,0 @@ let set = enabledTypes.get(compiler);

@@ -62,3 +62,3 @@ /*

return {
name: /** @type {string=} */ (name)
name: /** @type {string} */ (name)
};

@@ -65,0 +65,0 @@ }

@@ -151,2 +151,6 @@ /*

/**
* @param {string} str the string to replace
* @returns {string} the replaced keys
*/
const replaceKeys = str => {

@@ -182,2 +186,6 @@ return compilation.getPath(str, {

/**
* @param {string} type the type
* @returns {string} external require array
*/
const externalsRequireArray = type => {

@@ -190,3 +198,5 @@ return replaceKeys(

if (typeof request === "object") {
request = request[type];
request =
/** @type {Record<string, string | string[]>} */
(request)[type];
}

@@ -252,2 +262,6 @@ if (request === undefined) {

/**
* @param {keyof LibraryCustomUmdCommentObject} type type
* @returns {string} comment
*/
const getAuxiliaryComment = type => {

@@ -306,3 +320,7 @@ if (auxiliaryComment) {

replaceKeys(
accessorAccess("root", names.root || names.commonjs)
accessorAccess(
"root",
/** @type {string | string[]} */ (names.root) ||
/** @type {string} */ (names.commonjs)
)
) +

@@ -309,0 +327,0 @@ " = factory(" +

@@ -56,3 +56,3 @@ /*

* @param {RuntimeSpec} runtime runtime
* @param {function(string): void} fn functor
* @param {function(string | undefined): void} fn functor
* @param {boolean} deterministicOrder enforce a deterministic order

@@ -74,2 +74,7 @@ * @returns {void}

/**
* @template T
* @param {SortableSet<T>} set set
* @returns {string} runtime key
*/
const getRuntimesKey = set => {

@@ -103,2 +108,7 @@ set.sort();

/**
* @template T
* @param {SortableSet<T>} set set
* @returns {string} runtime string
*/
const getRuntimesString = set => {

@@ -423,2 +433,7 @@ set.sort();

* @template T
* @typedef {Map<string, T>} RuntimeSpecMapInnerMap
* */
/**
* @template T
*/

@@ -433,5 +448,5 @@ class RuntimeSpecMap {

this._singleRuntime = clone ? clone._singleRuntime : undefined;
/** @type {T} */
/** @type {T | undefined} */
this._singleValue = clone ? clone._singleValue : undefined;
/** @type {Map<string, T> | undefined} */
/** @type {RuntimeSpecMapInnerMap<T> | undefined} */
this._map = clone && clone._map ? new Map(clone._map) : undefined;

@@ -453,3 +468,5 @@ }

default:
return this._map.get(getRuntimeKey(runtime));
return /** @type {RuntimeSpecMapInnerMap<T>} */ (this._map).get(
getRuntimeKey(runtime)
);
}

@@ -469,6 +486,12 @@ }

default:
return this._map.has(getRuntimeKey(runtime));
return /** @type {RuntimeSpecMapInnerMap<T>} */ (this._map).has(
getRuntimeKey(runtime)
);
}
}
/**
* @param {RuntimeSpec} runtime the runtimes
* @param {T} value the value
*/
set(runtime, value) {

@@ -488,3 +511,6 @@ switch (this._mode) {

this._map = new Map();
this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue);
this._map.set(
getRuntimeKey(this._singleRuntime),
/** @type {T} */ (this._singleValue)
);
this._singleRuntime = undefined;

@@ -494,6 +520,12 @@ this._singleValue = undefined;

default:
this._map.set(getRuntimeKey(runtime), value);
/** @type {RuntimeSpecMapInnerMap<T>} */
(this._map).set(getRuntimeKey(runtime), value);
}
}
/**
* @param {RuntimeSpec} runtime the runtimes
* @param {() => TODO} computer function to compute the value
* @returns {TODO} true, when the runtime was deleted
*/
provide(runtime, computer) {

@@ -507,7 +539,10 @@ switch (this._mode) {

if (runtimeEqual(this._singleRuntime, runtime)) {
return this._singleValue;
return /** @type {T} */ (this._singleValue);
}
this._mode = 2;
this._map = new Map();
this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue);
this._map.set(
getRuntimeKey(this._singleRuntime),
/** @type {T} */ (this._singleValue)
);
this._singleRuntime = undefined;

@@ -521,6 +556,7 @@ this._singleValue = undefined;

const key = getRuntimeKey(runtime);
const value = this._map.get(key);
const value = /** @type {Map<string, T>} */ (this._map).get(key);
if (value !== undefined) return value;
const newValue = computer();
this._map.set(key, newValue);
/** @type {Map<string, T>} */
(this._map).set(key, newValue);
return newValue;

@@ -546,6 +582,11 @@ }

default:
this._map.delete(getRuntimeKey(runtime));
/** @type {RuntimeSpecMapInnerMap<T>} */
(this._map).delete(getRuntimeKey(runtime));
}
}
/**
* @param {RuntimeSpec} runtime the runtimes
* @param {function(T | undefined): T} fn function to update the value
*/
update(runtime, fn) {

@@ -564,3 +605,6 @@ switch (this._mode) {

this._map = new Map();
this._map.set(getRuntimeKey(this._singleRuntime), this._singleValue);
this._map.set(
getRuntimeKey(this._singleRuntime),
/** @type {T} */ (this._singleValue)
);
this._singleRuntime = undefined;

@@ -574,5 +618,7 @@ this._singleValue = undefined;

const key = getRuntimeKey(runtime);
const oldValue = this._map.get(key);
const oldValue = /** @type {Map<string, T>} */ (this._map).get(key);
const newValue = fn(oldValue);
if (newValue !== oldValue) this._map.set(key, newValue);
if (newValue !== oldValue)
/** @type {RuntimeSpecMapInnerMap<T>} */
(this._map).set(key, newValue);
}

@@ -589,3 +635,7 @@ }

default:
return Array.from(this._map.keys(), keyToRuntime);
return Array.from(
/** @type {RuntimeSpecMapInnerMap<T>} */
(this._map).keys(),
keyToRuntime
);
}

@@ -599,5 +649,5 @@ }

case 1:
return [this._singleValue][Symbol.iterator]();
return [/** @type {T} */ (this._singleValue)][Symbol.iterator]();
default:
return this._map.values();
return /** @type {Map<string, T>} */ (this._map).values();
}

@@ -607,4 +657,4 @@ }

get size() {
if (this._mode <= 1) return this._mode;
return this._map.size;
if (/** @type {number} */ (this._mode) <= 1) return this._mode;
return /** @type {Map<string, T>} */ (this._map).size;
}

@@ -611,0 +661,0 @@ }

@@ -8,2 +8,3 @@ /*

/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
/** @typedef {(string|number|undefined|[])[]} SemVerRange */

@@ -10,0 +11,0 @@

@@ -22,3 +22,3 @@ /*

* @param {ReadonlyMap<K, V>} map map to add
* @param {boolean} immutable if 'map' is immutable and StackedCacheMap can keep referencing it
* @param {boolean=} immutable if 'map' is immutable and StackedCacheMap can keep referencing it
*/

@@ -25,0 +25,0 @@ addAll(map, immutable) {

@@ -79,3 +79,3 @@ /*

* @param {string} specifier specifier
* @returns {string|null} protocol if absolute URL specifier provided
* @returns {string | null | undefined} protocol if absolute URL specifier provided
*/

@@ -82,0 +82,0 @@ function getProtocol(specifier) {

@@ -14,2 +14,4 @@ /*

/** @typedef {import("./FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */
/** @typedef {import("./WebpackError")} WebpackError */
/** @typedef {import("./logging/Logger").Logger} Logger */

@@ -62,5 +64,5 @@ /**

this.pausedWatcher = undefined;
/** @type {Set<string>} */
/** @type {Set<string> | undefined} */
this._collectedChangedFiles = undefined;
/** @type {Set<string>} */
/** @type {Set<string> | undefined} */
this._collectedRemovedFiles = undefined;

@@ -74,4 +76,4 @@ this._done = this._done.bind(this);

/**
* @param {ReadonlySet<string>} changedFiles changed files
* @param {ReadonlySet<string>} removedFiles removed files
* @param {ReadonlySet<string>=} changedFiles changed files
* @param {ReadonlySet<string>=} removedFiles removed files
*/

@@ -86,7 +88,9 @@ _mergeWithCollected(changedFiles, removedFiles) {

this._collectedChangedFiles.add(file);
this._collectedRemovedFiles.delete(file);
/** @type {Set<string>} */
(this._collectedRemovedFiles).delete(file);
}
for (const file of removedFiles) {
for (const file of /** @type {ReadonlySet<string>} */ (removedFiles)) {
this._collectedChangedFiles.delete(file);
this._collectedRemovedFiles.add(file);
/** @type {Set<string>} */
(this._collectedRemovedFiles).add(file);
}

@@ -235,3 +239,3 @@ }

/**
* @param {Error=} err an optional error
* @param {(Error | null)=} err an optional error
* @param {Compilation=} compilation the compilation

@@ -245,4 +249,9 @@ * @returns {void}

/** @type {Stats | null} */
let stats = null;
/**
* @param {Error} err error
* @param {Callback<void>[]=} cbs callbacks
*/
const handleError = (err, cbs) => {

@@ -252,3 +261,3 @@ this.compiler.hooks.failed.call(err);

this.compiler.idle = true;
this.handler(err, stats);
this.handler(err, /** @type {Stats} */ (stats));
if (!cbs) {

@@ -268,7 +277,9 @@ cbs = this.callbacks;

if (compilation) {
logger.time("storeBuildDependencies");
/** @type {Logger} */
(logger).time("storeBuildDependencies");
this.compiler.cache.storeBuildDependencies(
compilation.buildDependencies,
err => {
logger.timeEnd("storeBuildDependencies");
/** @type {Logger} */
(logger).timeEnd("storeBuildDependencies");
if (err) return handleError(err);

@@ -294,23 +305,33 @@ this._go();

this.callbacks = [];
logger.time("done hook");
this.compiler.hooks.done.callAsync(stats, err => {
logger.timeEnd("done hook");
/** @type {Logger} */
(logger).time("done hook");
this.compiler.hooks.done.callAsync(/** @type {Stats} */ (stats), err => {
/** @type {Logger} */
(logger).timeEnd("done hook");
if (err) return handleError(err, cbs);
this.handler(null, stats);
logger.time("storeBuildDependencies");
this.handler(null, /** @type {Stats} */ (stats));
/** @type {Logger} */
(logger).time("storeBuildDependencies");
this.compiler.cache.storeBuildDependencies(
compilation.buildDependencies,
/** @type {Compilation} */
(compilation).buildDependencies,
err => {
logger.timeEnd("storeBuildDependencies");
/** @type {Logger} */
(logger).timeEnd("storeBuildDependencies");
if (err) return handleError(err, cbs);
logger.time("beginIdle");
/** @type {Logger} */
(logger).time("beginIdle");
this.compiler.cache.beginIdle();
this.compiler.idle = true;
logger.timeEnd("beginIdle");
/** @type {Logger} */
(logger).timeEnd("beginIdle");
process.nextTick(() => {
if (!this.closed) {
this.watch(
compilation.fileDependencies,
compilation.contextDependencies,
compilation.missingDependencies
/** @type {Compilation} */
(compilation).fileDependencies,
/** @type {Compilation} */
(compilation).contextDependencies,
/** @type {Compilation} */
(compilation).missingDependencies
);

@@ -320,3 +341,3 @@ }

for (const cb of cbs) cb(null);
this.compiler.hooks.afterDone.call(stats);
this.compiler.hooks.afterDone.call(/** @type {Stats} */ (stats));
}

@@ -390,2 +411,9 @@ );

/**
* @param {ReadonlyMap<string, FileSystemInfoEntry | "ignore">=} fileTimeInfoEntries info for files
* @param {ReadonlyMap<string, FileSystemInfoEntry | "ignore">=} contextTimeInfoEntries info for directories
* @param {ReadonlySet<string>=} changedFiles changed files
* @param {ReadonlySet<string>=} removedFiles removed files
* @returns {void}
*/
_invalidate(

@@ -437,2 +465,6 @@ fileTimeInfoEntries,

}
/**
* @param {(WebpackError | null)=} err error if any
* @param {Compilation=} compilation compilation if any
*/
const finalCallback = (err, compilation) => {

@@ -448,5 +480,10 @@ this.running = false;

this.compiler.fsStartTime = undefined;
/**
* @param {(WebpackError | null)=} err error if any
*/
const shutdown = err => {
this.compiler.hooks.watchClose.call();
const closeCallbacks = this._closeCallbacks;
const closeCallbacks =
/** @type {Callback<void>[]} */
(this._closeCallbacks);
this._closeCallbacks = undefined;

@@ -453,0 +490,0 @@ for (const cb of closeCallbacks) cb(err);

{
"name": "webpack",
"version": "5.88.0",
"version": "5.88.1",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",

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

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

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc