Framework updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-03-04 23:20:19 +00:00
parent a89daf3d43
commit 3ed8517b2a
891 changed files with 11126 additions and 9600 deletions

View File

@@ -86,7 +86,19 @@ const getNormalModule = memoize(() => require("../NormalModule"));
const type = ASSET_MODULE_TYPE;
const PLUGIN_NAME = "AssetModulesPlugin";
/**
* @typedef {object} AssetModulesPluginOptions
* @property {boolean=} sideEffectFree
*/
class AssetModulesPlugin {
/**
* @param {AssetModulesPluginOptions} options options
*/
constructor(options) {
this.options = options;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
@@ -112,7 +124,10 @@ class AssetModulesPlugin {
/** @type {NormalModuleCreateData} */
(createData)
);
module.factoryMeta = { sideEffectFree: true };
if (this.options.sideEffectFree) {
module.factoryMeta = { sideEffectFree: true };
}
return module;
});
}

View File

@@ -42,9 +42,13 @@ class RawDataUrlModule extends Module {
*/
constructor(url, identifier, readableIdentifier) {
super(ASSET_MODULE_TYPE_RAW_DATA_URL, null);
/** @type {string} */
this.url = url;
/** @type {Buffer | undefined} */
this.urlBuffer = url ? Buffer.from(url) : undefined;
this.identifierStr = identifier || this.url;
/** @type {string} */
this.identifierStr = identifier;
/** @type {string} */
this.readableIdentifierStr = readableIdentifier || this.identifierStr;
}