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/ids/NamedChunkIdsPlugin.js | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/node_modules/webpack/lib/ids/NamedChunkIdsPlugin.js b/node_modules/webpack/lib/ids/NamedChunkIdsPlugin.js
index bcb5160..5b74414 100644
--- a/node_modules/webpack/lib/ids/NamedChunkIdsPlugin.js
+++ b/node_modules/webpack/lib/ids/NamedChunkIdsPlugin.js
@@ -17,6 +17,7 @@
/** @typedef {import("../Compiler")} Compiler */
/**
+ * Defines the named chunk ids plugin options type used by this module.
* @typedef {object} NamedChunkIdsPluginOptions
* @property {string=} context context
* @property {string=} delimiter delimiter
@@ -26,15 +27,16 @@
class NamedChunkIdsPlugin {
/**
+ * Creates an instance of NamedChunkIdsPlugin.
* @param {NamedChunkIdsPluginOptions=} options options
*/
- constructor(options) {
- this.delimiter = (options && options.delimiter) || "-";
- this.context = options && options.context;
+ constructor(options = {}) {
+ /** @type {NamedChunkIdsPluginOptions} */
+ this.options = options;
}
/**
- * Apply the plugin
+ * Applies the plugin by registering its hooks on the compiler.
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
@@ -43,8 +45,10 @@
const hashFunction = compilation.outputOptions.hashFunction;
compilation.hooks.chunkIds.tap(PLUGIN_NAME, (chunks) => {
const chunkGraph = compilation.chunkGraph;
- const context = this.context ? this.context : compiler.context;
- const delimiter = this.delimiter;
+ const context = this.options.context
+ ? this.options.context
+ : compiler.context;
+ const delimiter = this.options.delimiter || "-";
const unnamedChunks = assignNames(
[...chunks].filter((chunk) => {
--
Gitblit v1.9.3