From 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 四月 2026 11:46:41 +0800
Subject: [PATCH] 推送
---
node_modules/webpack/lib/performance/SizeLimitsPlugin.js | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/node_modules/webpack/lib/performance/SizeLimitsPlugin.js b/node_modules/webpack/lib/performance/SizeLimitsPlugin.js
index 1ad41e3..e19ebb4 100644
--- a/node_modules/webpack/lib/performance/SizeLimitsPlugin.js
+++ b/node_modules/webpack/lib/performance/SizeLimitsPlugin.js
@@ -19,12 +19,14 @@
/** @typedef {import("../WebpackError")} WebpackError */
/**
+ * Defines the asset details type used by this module.
* @typedef {object} AssetDetails
* @property {string} name
* @property {number} size
*/
/**
+ * Defines the entrypoint details type used by this module.
* @typedef {object} EntrypointDetails
* @property {string} name
* @property {number} size
@@ -34,28 +36,31 @@
/** @type {WeakSet<Entrypoint | ChunkGroup | Source>} */
const isOverSizeLimitSet = new WeakSet();
-/**
- * @param {Asset["name"]} name the name
- * @param {Asset["source"]} source the source
- * @param {Asset["info"]} info the info
- * @returns {boolean} result
- */
+/** @typedef {(name: Asset["name"], source: Asset["source"], assetInfo: Asset["info"]) => boolean} AssetFilter */
+
+/** @type {AssetFilter} */
const excludeSourceMap = (name, source, info) => !info.development;
const PLUGIN_NAME = "SizeLimitsPlugin";
module.exports = class SizeLimitsPlugin {
/**
+ * Creates an instance of SizeLimitsPlugin.
* @param {PerformanceOptions} options the plugin options
*/
constructor(options) {
+ /** @type {PerformanceOptions["hints"]} */
this.hints = options.hints;
+ /** @type {number | undefined} */
this.maxAssetSize = options.maxAssetSize;
+ /** @type {number | undefined} */
this.maxEntrypointSize = options.maxEntrypointSize;
+ /** @type {AssetFilter | undefined} */
this.assetFilter = options.assetFilter;
}
/**
+ * Checks whether this size limits plugin is over size limit.
* @param {Entrypoint | ChunkGroup | Source} thing the resource to test
* @returns {boolean} true if over the limit
*/
@@ -64,7 +69,7 @@
}
/**
- * Apply the plugin
+ * Applies the plugin by registering its hooks on the compiler.
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
@@ -79,6 +84,7 @@
const warnings = [];
/**
+ * Gets entrypoint size.
* @param {Entrypoint} entrypoint an entrypoint
* @returns {number} the size of the entrypoint
*/
@@ -115,6 +121,7 @@
}
/**
+ * Returns result.
* @param {Asset["name"]} name the name
* @returns {boolean | undefined} result
*/
--
Gitblit v1.9.3