From 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 18:09:58 +0800
Subject: [PATCH] 上报转运调试
---
node_modules/webpack/lib/sharing/resolveMatchedConfigs.js | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/node_modules/webpack/lib/sharing/resolveMatchedConfigs.js b/node_modules/webpack/lib/sharing/resolveMatchedConfigs.js
index 152f1db..f656619 100644
--- a/node_modules/webpack/lib/sharing/resolveMatchedConfigs.js
+++ b/node_modules/webpack/lib/sharing/resolveMatchedConfigs.js
@@ -10,31 +10,40 @@
/** @typedef {import("enhanced-resolve").ResolveContext} ResolveContext */
/** @typedef {import("../Compilation")} Compilation */
+/** @typedef {import("../Compilation").FileSystemDependencies} FileSystemDependencies */
/** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */
/**
+ * Defines the matched configs item type used by this module.
+ * @template T
+ * @typedef {Map<string, T>} MatchedConfigsItem
+ */
+
+/**
+ * Defines the matched configs type used by this module.
* @template T
* @typedef {object} MatchedConfigs
- * @property {Map<string, T>} resolved
- * @property {Map<string, T>} unresolved
- * @property {Map<string, T>} prefixed
+ * @property {MatchedConfigsItem<T>} resolved
+ * @property {MatchedConfigsItem<T>} unresolved
+ * @property {MatchedConfigsItem<T>} prefixed
*/
/** @type {ResolveOptionsWithDependencyType} */
const RESOLVE_OPTIONS = { dependencyType: "esm" };
/**
+ * Returns resolved matchers.
* @template T
* @param {Compilation} compilation the compilation
* @param {[string, T][]} configs to be processed configs
* @returns {Promise<MatchedConfigs<T>>} resolved matchers
*/
module.exports.resolveMatchedConfigs = (compilation, configs) => {
- /** @type {Map<string, T>} */
+ /** @type {MatchedConfigsItem<T>} */
const resolved = new Map();
- /** @type {Map<string, T>} */
+ /** @type {MatchedConfigsItem<T>} */
const unresolved = new Map();
- /** @type {Map<string, T>} */
+ /** @type {MatchedConfigsItem<T>} */
const prefixed = new Map();
/** @type {ResolveContext} */
const resolveContext = {
@@ -48,7 +57,7 @@
return Promise.all(
// eslint-disable-next-line array-callback-return
configs.map(([request, config]) => {
- if (/^\.\.?(\/|$)/.test(request)) {
+ if (/^\.\.?(?:\/|$)/.test(request)) {
// relative request
return new Promise((resolve) => {
resolver.resolve(
@@ -71,7 +80,7 @@
}
);
});
- } else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) {
+ } else if (/^(?:\/|[a-z]:\\|\\\\)/i.test(request)) {
// absolute path
resolved.set(request, config);
} else if (request.endsWith("/")) {
@@ -84,15 +93,15 @@
})
).then(() => {
compilation.contextDependencies.addAll(
- /** @type {LazySet<string>} */
+ /** @type {FileSystemDependencies} */
(resolveContext.contextDependencies)
);
compilation.fileDependencies.addAll(
- /** @type {LazySet<string>} */
+ /** @type {FileSystemDependencies} */
(resolveContext.fileDependencies)
);
compilation.missingDependencies.addAll(
- /** @type {LazySet<string>} */
+ /** @type {FileSystemDependencies} */
(resolveContext.missingDependencies)
);
return { resolved, unresolved, prefixed };
--
Gitblit v1.9.3