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/dependencies/HarmonyModulesPlugin.js | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/node_modules/webpack/lib/dependencies/HarmonyModulesPlugin.js b/node_modules/webpack/lib/dependencies/HarmonyModulesPlugin.js
index c2d1847..0f06526 100644
--- a/node_modules/webpack/lib/dependencies/HarmonyModulesPlugin.js
+++ b/node_modules/webpack/lib/dependencies/HarmonyModulesPlugin.js
@@ -9,6 +9,7 @@
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_ESM
} = require("../ModuleTypeConstants");
+const CreateRequireParserPlugin = require("./CreateRequireParserPlugin");
const HarmonyAcceptDependency = require("./HarmonyAcceptDependency");
const HarmonyAcceptImportDependency = require("./HarmonyAcceptImportDependency");
const HarmonyCompatibilityDependency = require("./HarmonyCompatibilityDependency");
@@ -30,6 +31,7 @@
/** @typedef {import("../javascript/JavascriptParser")} Parser */
/**
+ * Defines the harmony modules plugin options type used by this module.
* @typedef {object} HarmonyModulesPluginOptions
* @property {boolean=} deferImport
*/
@@ -38,6 +40,7 @@
class HarmonyModulesPlugin {
/**
+ * Creates an instance of HarmonyModulesPlugin.
* @param {HarmonyModulesPluginOptions} options options
*/
constructor(options) {
@@ -45,7 +48,7 @@
}
/**
- * Apply the plugin
+ * Applies the plugin by registering its hooks on the compiler.
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
@@ -124,6 +127,7 @@
);
/**
+ * Handles the hook callback for this code path.
* @param {Parser} parser parser parser
* @param {JavascriptParserOptions} parserOptions parserOptions
* @returns {void}
@@ -138,6 +142,9 @@
new HarmonyImportDependencyParserPlugin(parserOptions).apply(parser);
new HarmonyExportDependencyParserPlugin(parserOptions).apply(parser);
new HarmonyTopLevelThisParserPlugin().apply(parser);
+ if (parserOptions.createRequire) {
+ new CreateRequireParserPlugin(parserOptions).apply(parser);
+ }
};
normalModuleFactory.hooks.parser
--
Gitblit v1.9.3