From 9bce51f651aad297ef9eb6df832bfdaf1de05d84 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期三, 22 四月 2026 14:27:54 +0800
Subject: [PATCH] 青岛推送
---
node_modules/webpack/lib/dependencies/CssUrlDependency.js | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/node_modules/webpack/lib/dependencies/CssUrlDependency.js b/node_modules/webpack/lib/dependencies/CssUrlDependency.js
index ddffec7..0e3952a 100644
--- a/node_modules/webpack/lib/dependencies/CssUrlDependency.js
+++ b/node_modules/webpack/lib/dependencies/CssUrlDependency.js
@@ -13,9 +13,10 @@
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("../CodeGenerationResults")} CodeGenerationResults */
/** @typedef {import("../Dependency")} Dependency */
-/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
+/** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
+/** @typedef {import("../Module").CodeGenerationResultData} CodeGenerationResultData */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
@@ -27,6 +28,7 @@
class CssUrlDependency extends ModuleDependency {
/**
+ * Creates an instance of CssUrlDependency.
* @param {string} request request
* @param {Range} range range of the argument
* @param {"string" | "url" | "src"} urlType dependency type e.g. url() or string
@@ -46,6 +48,7 @@
}
/**
+ * Creates an ignored module.
* @param {string} context context directory
* @returns {Module} ignored module
*/
@@ -54,6 +57,7 @@
}
/**
+ * Serializes this instance into the provided serializer context.
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
@@ -63,6 +67,7 @@
}
/**
+ * Restores this instance from the provided deserializer context.
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
@@ -73,6 +78,7 @@
}
/**
+ * Returns string in quotes if needed.
* @param {string} str string
* @returns {string} string in quotes if needed
*/
@@ -110,6 +116,7 @@
ModuleDependency.Template
) {
/**
+ * Applies the plugin by registering its hooks on the compiler.
* @param {Dependency} dependency the dependency for which the template should be applied
* @param {ReplaceSource} source the current replace source which can be modified
* @param {DependencyTemplateContext} templateContext the context object
@@ -118,8 +125,9 @@
apply(
dependency,
source,
- { moduleGraph, runtimeTemplate, codeGenerationResults }
+ { type, moduleGraph, runtimeTemplate, codeGenerationResults }
) {
+ if (type === "javascript") return;
const dep = /** @type {CssUrlDependency} */ (dependency);
const module = /** @type {Module} */ (moduleGraph.getModule(dep));
@@ -161,6 +169,7 @@
}
/**
+ * Returns the url of the asset.
* @param {object} options options object
* @param {Module} options.module the module
* @param {RuntimeSpec=} options.runtime runtime
@@ -172,9 +181,7 @@
return "data:,";
}
const codeGen = codeGenerationResults.get(module, runtime);
- const data =
- /** @type {NonNullable<CodeGenerationResult["data"]>} */
- (codeGen.data);
+ const data = codeGen.data;
if (!data) return "data:,";
const url = data.get("url");
if (!url || !url["css-url"]) return "data:,";
--
Gitblit v1.9.3