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/IgnorePlugin.js |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/node_modules/webpack/lib/IgnorePlugin.js b/node_modules/webpack/lib/IgnorePlugin.js
index 0bbf187..10192a1 100644
--- a/node_modules/webpack/lib/IgnorePlugin.js
+++ b/node_modules/webpack/lib/IgnorePlugin.js
@@ -7,21 +7,11 @@
 
 const RawModule = require("./RawModule");
 const EntryDependency = require("./dependencies/EntryDependency");
-const createSchemaValidation = require("./util/create-schema-validation");
 
 /** @typedef {import("../declarations/plugins/IgnorePlugin").IgnorePluginOptions} IgnorePluginOptions */
 /** @typedef {import("./Compiler")} Compiler */
 /** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */
 /** @typedef {import("./ContextModuleFactory").BeforeContextResolveData} BeforeContextResolveData */
-
-const validate = createSchemaValidation(
-	require("../schemas/plugins/IgnorePlugin.check"),
-	() => require("../schemas/plugins/IgnorePlugin.json"),
-	{
-		name: "Ignore Plugin",
-		baseDataPath: "options"
-	}
-);
 
 /** @typedef {(resource: string, context: string) => boolean} CheckResourceFn */
 
@@ -29,10 +19,10 @@
 
 class IgnorePlugin {
 	/**
+	 * Creates an instance of IgnorePlugin.
 	 * @param {IgnorePluginOptions} options IgnorePlugin options
 	 */
 	constructor(options) {
-		validate(options);
 		this.options = options;
 		this.checkIgnore = this.checkIgnore.bind(this);
 	}
@@ -69,11 +59,23 @@
 	}
 
 	/**
-	 * Apply the plugin
+	 * Applies the plugin by registering its hooks on the compiler.
 	 * @param {Compiler} compiler the compiler instance
 	 * @returns {void}
 	 */
 	apply(compiler) {
+		compiler.hooks.validate.tap(PLUGIN_NAME, () => {
+			compiler.validate(
+				require("../schemas/plugins/IgnorePlugin.json"),
+				this.options,
+				{
+					name: "Ignore Plugin",
+					baseDataPath: "options"
+				},
+				(options) => require("../schemas/plugins/IgnorePlugin.check")(options)
+			);
+		});
+
 		compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, (nmf) => {
 			nmf.hooks.beforeResolve.tap(PLUGIN_NAME, (resolveData) => {
 				const result = this.checkIgnore(resolveData);

--
Gitblit v1.9.3