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/wasm-sync/WebAssemblyModulesPlugin.js | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/node_modules/webpack/lib/wasm-sync/WebAssemblyModulesPlugin.js b/node_modules/webpack/lib/wasm-sync/WebAssemblyModulesPlugin.js
index f77cab8..8e6ce9b 100644
--- a/node_modules/webpack/lib/wasm-sync/WebAssemblyModulesPlugin.js
+++ b/node_modules/webpack/lib/wasm-sync/WebAssemblyModulesPlugin.js
@@ -6,10 +6,14 @@
"use strict";
const Generator = require("../Generator");
+const {
+ JAVASCRIPT_TYPE,
+ WEBASSEMBLY_TYPE
+} = require("../ModuleSourceTypeConstants");
const { WEBASSEMBLY_MODULE_TYPE_SYNC } = require("../ModuleTypeConstants");
const WebAssemblyExportImportedDependency = require("../dependencies/WebAssemblyExportImportedDependency");
const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDependency");
-const { compareModulesByIdOrIdentifier } = require("../util/comparators");
+const { compareModulesByFullName } = require("../util/comparators");
const memoize = require("../util/memoize");
const WebAssemblyInInitialChunkError = require("./WebAssemblyInInitialChunkError");
@@ -27,12 +31,19 @@
const PLUGIN_NAME = "WebAssemblyModulesPlugin";
/**
+ * Options that influence how synchronous WebAssembly modules are transformed
+ * and emitted.
* @typedef {object} WebAssemblyModulesPluginOptions
* @property {boolean=} mangleImports mangle imports
*/
+/**
+ * Adds parser, generator, manifest, and validation support for synchronous
+ * WebAssembly modules in the compilation pipeline.
+ */
class WebAssemblyModulesPlugin {
/**
+ * Stores options that affect generated synchronous WebAssembly output.
* @param {WebAssemblyModulesPluginOptions} options options
*/
constructor(options) {
@@ -40,7 +51,9 @@
}
/**
- * Apply the plugin
+ * Registers compilation hooks that parse and generate sync WebAssembly
+ * modules, emit their binary assets, and report invalid placement in initial
+ * chunks.
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
@@ -74,8 +87,8 @@
const WebAssemblyGenerator = getWebAssemblyGenerator();
return Generator.byType({
- javascript: new WebAssemblyJavascriptGenerator(),
- webassembly: new WebAssemblyGenerator(this.options)
+ [JAVASCRIPT_TYPE]: new WebAssemblyJavascriptGenerator(),
+ [WEBASSEMBLY_TYPE]: new WebAssemblyGenerator(this.options)
});
});
@@ -85,7 +98,7 @@
for (const module of chunkGraph.getOrderedChunkModulesIterable(
chunk,
- compareModulesByIdOrIdentifier(chunkGraph)
+ compareModulesByFullName(compiler)
)) {
if (module.type === WEBASSEMBLY_MODULE_TYPE_SYNC) {
const filenameTemplate = outputOptions.webassemblyModuleFilename;
--
Gitblit v1.9.3