Enhance refactor commands with controller-aware Route() updates and fix code quality violations
Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
167
node_modules/webpack/lib/asset/AssetBytesGenerator.js
generated
vendored
Executable file
167
node_modules/webpack/lib/asset/AssetBytesGenerator.js
generated
vendored
Executable file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Alexander Akait @alexander-akait
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const { RawSource } = require("webpack-sources");
|
||||
const ConcatenationScope = require("../ConcatenationScope");
|
||||
const Generator = require("../Generator");
|
||||
const {
|
||||
CSS_URL_TYPES,
|
||||
JS_AND_CSS_URL_TYPES,
|
||||
JS_TYPES,
|
||||
NO_TYPES
|
||||
} = require("../ModuleSourceTypesConstants");
|
||||
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../Generator").GenerateContext} GenerateContext */
|
||||
/** @typedef {import("../Module").ConcatenationBailoutReasonContext} ConcatenationBailoutReasonContext */
|
||||
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
||||
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
||||
/** @typedef {import("../NormalModule")} NormalModule */
|
||||
|
||||
class AssetSourceGenerator extends Generator {
|
||||
/**
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
*/
|
||||
constructor(moduleGraph) {
|
||||
super();
|
||||
|
||||
this._moduleGraph = moduleGraph;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {NormalModule} module module for which the code should be generated
|
||||
* @param {GenerateContext} generateContext context for generate
|
||||
* @returns {Source | null} generated code
|
||||
*/
|
||||
generate(
|
||||
module,
|
||||
{ type, concatenationScope, getData, runtimeTemplate, runtimeRequirements }
|
||||
) {
|
||||
const originalSource = module.originalSource();
|
||||
const data = getData ? getData() : undefined;
|
||||
|
||||
switch (type) {
|
||||
case "javascript": {
|
||||
if (!originalSource) {
|
||||
return new RawSource("");
|
||||
}
|
||||
|
||||
const encodedSource = originalSource.buffer().toString("base64");
|
||||
|
||||
runtimeRequirements.add(RuntimeGlobals.requireScope);
|
||||
runtimeRequirements.add(RuntimeGlobals.toBinary);
|
||||
|
||||
let sourceContent;
|
||||
if (concatenationScope) {
|
||||
concatenationScope.registerNamespaceExport(
|
||||
ConcatenationScope.NAMESPACE_OBJECT_EXPORT
|
||||
);
|
||||
sourceContent = `${runtimeTemplate.renderConst()} ${
|
||||
ConcatenationScope.NAMESPACE_OBJECT_EXPORT
|
||||
} = ${RuntimeGlobals.toBinary}(${JSON.stringify(encodedSource)});`;
|
||||
} else {
|
||||
runtimeRequirements.add(RuntimeGlobals.module);
|
||||
sourceContent = `${RuntimeGlobals.module}.exports = ${RuntimeGlobals.toBinary}(${JSON.stringify(
|
||||
encodedSource
|
||||
)});`;
|
||||
}
|
||||
return new RawSource(sourceContent);
|
||||
}
|
||||
case "css-url": {
|
||||
if (!originalSource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const encodedSource = originalSource.buffer().toString("base64");
|
||||
|
||||
if (data) {
|
||||
data.set("url", {
|
||||
[type]: `data:application/octet-stream;base64,${encodedSource}`
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Error} error the error
|
||||
* @param {NormalModule} module module for which the code should be generated
|
||||
* @param {GenerateContext} generateContext context for generate
|
||||
* @returns {Source | null} generated code
|
||||
*/
|
||||
generateError(error, module, generateContext) {
|
||||
switch (generateContext.type) {
|
||||
case "javascript": {
|
||||
return new RawSource(
|
||||
`throw new Error(${JSON.stringify(error.message)});`
|
||||
);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {NormalModule} module module for which the bailout reason should be determined
|
||||
* @param {ConcatenationBailoutReasonContext} context context
|
||||
* @returns {string | undefined} reason why this module can't be concatenated, undefined when it can be concatenated
|
||||
*/
|
||||
getConcatenationBailoutReason(module, context) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {NormalModule} module fresh module
|
||||
* @returns {SourceTypes} available types (do not mutate)
|
||||
*/
|
||||
getTypes(module) {
|
||||
/** @type {Set<string>} */
|
||||
const sourceTypes = new Set();
|
||||
const connections = this._moduleGraph.getIncomingConnections(module);
|
||||
|
||||
for (const connection of connections) {
|
||||
if (!connection.originModule) {
|
||||
continue;
|
||||
}
|
||||
|
||||
sourceTypes.add(connection.originModule.type.split("/")[0]);
|
||||
}
|
||||
|
||||
if (sourceTypes.size > 0) {
|
||||
if (sourceTypes.has("javascript") && sourceTypes.has("css")) {
|
||||
return JS_AND_CSS_URL_TYPES;
|
||||
} else if (sourceTypes.has("css")) {
|
||||
return CSS_URL_TYPES;
|
||||
}
|
||||
return JS_TYPES;
|
||||
}
|
||||
|
||||
return NO_TYPES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {NormalModule} module the module
|
||||
* @param {string=} type source type
|
||||
* @returns {number} estimate size of the module
|
||||
*/
|
||||
getSize(module, type) {
|
||||
const originalSource = module.originalSource();
|
||||
|
||||
if (!originalSource) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Example: m.exports="abcd"
|
||||
return originalSource.size() + 12;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AssetSourceGenerator;
|
||||
37
node_modules/webpack/lib/asset/AssetBytesParser.js
generated
vendored
Executable file
37
node_modules/webpack/lib/asset/AssetBytesParser.js
generated
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Alexander Akait @alexander-akait
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const Parser = require("../Parser");
|
||||
|
||||
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
||||
/** @typedef {import("../Module").BuildMeta} BuildMeta */
|
||||
/** @typedef {import("../Parser").ParserState} ParserState */
|
||||
/** @typedef {import("../Parser").PreparsedAst} PreparsedAst */
|
||||
|
||||
class AssetBytesParser extends Parser {
|
||||
/**
|
||||
* @param {string | Buffer | PreparsedAst} source the source to parse
|
||||
* @param {ParserState} state the parser state
|
||||
* @returns {ParserState} the parser state
|
||||
*/
|
||||
parse(source, state) {
|
||||
if (typeof source === "object" && !Buffer.isBuffer(source)) {
|
||||
throw new Error("AssetBytesParser doesn't accept preparsed AST");
|
||||
}
|
||||
const { module } = state;
|
||||
/** @type {BuildInfo} */
|
||||
(module.buildInfo).strict = true;
|
||||
/** @type {BuildMeta} */
|
||||
(module.buildMeta).exportsType = "default";
|
||||
/** @type {BuildMeta} */
|
||||
(state.module.buildMeta).defaultObject = false;
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AssetBytesParser;
|
||||
59
node_modules/webpack/lib/asset/AssetGenerator.js
generated
vendored
59
node_modules/webpack/lib/asset/AssetGenerator.js
generated
vendored
@@ -6,7 +6,6 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const mimeTypes = require("mime-types");
|
||||
const { RawSource } = require("webpack-sources");
|
||||
const ConcatenationScope = require("../ConcatenationScope");
|
||||
const Generator = require("../Generator");
|
||||
@@ -25,41 +24,38 @@ const RuntimeGlobals = require("../RuntimeGlobals");
|
||||
const CssUrlDependency = require("../dependencies/CssUrlDependency");
|
||||
const createHash = require("../util/createHash");
|
||||
const { makePathsRelative } = require("../util/identifier");
|
||||
const memoize = require("../util/memoize");
|
||||
const nonNumericOnlyHash = require("../util/nonNumericOnlyHash");
|
||||
|
||||
const getMimeTypes = memoize(() => require("mime-types"));
|
||||
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").AssetGeneratorDataUrlOptions} AssetGeneratorDataUrlOptions */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").AssetGeneratorOptions} AssetGeneratorOptions */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").AssetModuleFilename} AssetModuleFilename */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").AssetModuleOutputPath} AssetModuleOutputPath */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").AssetResourceGeneratorOptions} AssetResourceGeneratorOptions */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").HashFunction} HashFunction */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").RawPublicPath} RawPublicPath */
|
||||
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
||||
/** @typedef {import("../Compilation")} Compilation */
|
||||
/** @typedef {import("../Compilation").AssetInfo} AssetInfo */
|
||||
/** @typedef {import("../Compilation").InterpolatedPathAndAssetInfo} InterpolatedPathAndAssetInfo */
|
||||
/** @typedef {import("../Compiler")} Compiler */
|
||||
/** @typedef {import("../Generator").GenerateContext} GenerateContext */
|
||||
/** @typedef {import("../Generator").UpdateHashContext} UpdateHashContext */
|
||||
/** @typedef {import("../Module")} Module */
|
||||
/** @typedef {import("../Module").NameForCondition} NameForCondition */
|
||||
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
||||
/** @typedef {import("../Module").BuildMeta} BuildMeta */
|
||||
/** @typedef {import("../Module").ConcatenationBailoutReasonContext} ConcatenationBailoutReasonContext */
|
||||
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
||||
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
||||
/** @typedef {import("../NormalModule")} NormalModule */
|
||||
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
||||
/** @typedef {import("../TemplatedPathPlugin").TemplatePath} TemplatePath */
|
||||
/** @typedef {import("../util/Hash")} Hash */
|
||||
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @template U
|
||||
* @param {null | string | Array<T> | Set<T> | undefined} a a
|
||||
* @param {null | string | Array<U> | Set<U> | undefined} b b
|
||||
* @returns {Array<T> & Array<U>} array
|
||||
* @param {null | string | T[] | Set<T> | undefined} a a
|
||||
* @param {null | string | U[] | Set<U> | undefined} b b
|
||||
* @returns {T[] & U[]} array
|
||||
*/
|
||||
const mergeMaybeArrays = (a, b) => {
|
||||
const set = new Set();
|
||||
@@ -220,7 +216,8 @@ class AssetGenerator extends Generator {
|
||||
static getSourceFileName(module, runtimeTemplate) {
|
||||
return makePathsRelative(
|
||||
runtimeTemplate.compilation.compiler.context,
|
||||
module.matchResource || module.resource,
|
||||
/** @type {string} */
|
||||
(module.getResource()),
|
||||
runtimeTemplate.compilation.compiler.root
|
||||
).replace(/^\.\//, "");
|
||||
}
|
||||
@@ -231,10 +228,7 @@ class AssetGenerator extends Generator {
|
||||
* @returns {[string, string]} return full hash and non-numeric full hash
|
||||
*/
|
||||
static getFullContentHash(module, runtimeTemplate) {
|
||||
const hash = createHash(
|
||||
/** @type {HashFunction} */
|
||||
(runtimeTemplate.outputOptions.hashFunction)
|
||||
);
|
||||
const hash = createHash(runtimeTemplate.outputOptions.hashFunction);
|
||||
|
||||
if (runtimeTemplate.outputOptions.hashSalt) {
|
||||
hash.update(runtimeTemplate.outputOptions.hashSalt);
|
||||
@@ -250,15 +244,13 @@ class AssetGenerator extends Generator {
|
||||
hash.update(module.error.toString());
|
||||
}
|
||||
|
||||
const fullContentHash = /** @type {string} */ (
|
||||
hash.digest(runtimeTemplate.outputOptions.hashDigest)
|
||||
const fullContentHash = hash.digest(
|
||||
runtimeTemplate.outputOptions.hashDigest
|
||||
);
|
||||
|
||||
/** @type {string} */
|
||||
const contentHash = nonNumericOnlyHash(
|
||||
fullContentHash,
|
||||
/** @type {number} */
|
||||
(runtimeTemplate.outputOptions.hashDigestLength)
|
||||
runtimeTemplate.outputOptions.hashDigestLength
|
||||
);
|
||||
|
||||
return [fullContentHash, contentHash];
|
||||
@@ -279,8 +271,7 @@ class AssetGenerator extends Generator {
|
||||
) {
|
||||
const assetModuleFilename =
|
||||
generatorOptions.filename ||
|
||||
/** @type {AssetModuleFilename} */
|
||||
(runtimeTemplate.outputOptions.assetModuleFilename);
|
||||
runtimeTemplate.outputOptions.assetModuleFilename;
|
||||
|
||||
const sourceFilename = AssetGenerator.getSourceFileName(
|
||||
module,
|
||||
@@ -381,13 +372,9 @@ class AssetGenerator extends Generator {
|
||||
const path =
|
||||
compilation.outputOptions.publicPath === "auto"
|
||||
? CssUrlDependency.PUBLIC_PATH_AUTO
|
||||
: compilation.getAssetPath(
|
||||
/** @type {TemplatePath} */
|
||||
(compilation.outputOptions.publicPath),
|
||||
{
|
||||
hash: compilation.hash
|
||||
}
|
||||
);
|
||||
: compilation.getAssetPath(compilation.outputOptions.publicPath, {
|
||||
hash: compilation.hash
|
||||
});
|
||||
|
||||
assetPath = path + filename;
|
||||
}
|
||||
@@ -425,7 +412,7 @@ class AssetGenerator extends Generator {
|
||||
(this.dataUrlOptions).mimetype;
|
||||
if (mimeType === undefined) {
|
||||
const ext = path.extname(
|
||||
/** @type {string} */
|
||||
/** @type {NameForCondition} */
|
||||
(module.nameForCondition())
|
||||
);
|
||||
if (
|
||||
@@ -436,7 +423,7 @@ class AssetGenerator extends Generator {
|
||||
module.resourceResolveData.mimetype +
|
||||
module.resourceResolveData.parameters;
|
||||
} else if (ext) {
|
||||
mimeType = mimeTypes.lookup(ext);
|
||||
mimeType = getMimeTypes().lookup(ext);
|
||||
|
||||
if (typeof mimeType !== "string") {
|
||||
throw new Error(
|
||||
@@ -471,7 +458,7 @@ class AssetGenerator extends Generator {
|
||||
|
||||
if (typeof this.dataUrlOptions === "function") {
|
||||
encodedSource = this.dataUrlOptions.call(null, source.source(), {
|
||||
filename: module.matchResource || module.resource,
|
||||
filename: /** @type {string} */ (module.getResource()),
|
||||
module
|
||||
});
|
||||
} else {
|
||||
@@ -619,7 +606,7 @@ class AssetGenerator extends Generator {
|
||||
);
|
||||
|
||||
return new RawSource(
|
||||
`${runtimeTemplate.supportsConst() ? "const" : "var"} ${
|
||||
`${runtimeTemplate.renderConst()} ${
|
||||
ConcatenationScope.NAMESPACE_OBJECT_EXPORT
|
||||
} = ${content};`
|
||||
);
|
||||
@@ -794,9 +781,7 @@ class AssetGenerator extends Generator {
|
||||
}
|
||||
|
||||
const assetModuleFilename =
|
||||
this.filename ||
|
||||
/** @type {AssetModuleFilename} */
|
||||
(runtimeTemplate.outputOptions.assetModuleFilename);
|
||||
this.filename || runtimeTemplate.outputOptions.assetModuleFilename;
|
||||
const { path: filename, info } =
|
||||
runtimeTemplate.compilation.getAssetPathWithInfo(
|
||||
assetModuleFilename,
|
||||
|
||||
50
node_modules/webpack/lib/asset/AssetModulesPlugin.js
generated
vendored
50
node_modules/webpack/lib/asset/AssetModulesPlugin.js
generated
vendored
@@ -7,22 +7,19 @@
|
||||
|
||||
const {
|
||||
ASSET_MODULE_TYPE,
|
||||
ASSET_MODULE_TYPE_BYTES,
|
||||
ASSET_MODULE_TYPE_INLINE,
|
||||
ASSET_MODULE_TYPE_RESOURCE,
|
||||
ASSET_MODULE_TYPE_SOURCE
|
||||
} = require("../ModuleTypeConstants");
|
||||
const { cleverMerge } = require("../util/cleverMerge");
|
||||
const { compareModulesByIdOrIdentifier } = require("../util/comparators");
|
||||
const createSchemaValidation = require("../util/create-schema-validation");
|
||||
const memoize = require("../util/memoize");
|
||||
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").AssetParserOptions} AssetParserOptions */
|
||||
/** @typedef {import("schema-utils").Schema} Schema */
|
||||
/** @typedef {import("../Chunk")} Chunk */
|
||||
/** @typedef {import("../Compilation").AssetInfo} AssetInfo */
|
||||
/** @typedef {import("../Compiler")} Compiler */
|
||||
/** @typedef {import("../Module")} Module */
|
||||
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
||||
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
|
||||
/** @typedef {import("../NormalModule")} NormalModule */
|
||||
@@ -74,9 +71,11 @@ const validateParserOptions = createSchemaValidation(
|
||||
const getAssetGenerator = memoize(() => require("./AssetGenerator"));
|
||||
const getAssetParser = memoize(() => require("./AssetParser"));
|
||||
const getAssetSourceParser = memoize(() => require("./AssetSourceParser"));
|
||||
const getAssetBytesParser = memoize(() => require("./AssetBytesParser"));
|
||||
const getAssetSourceGenerator = memoize(() =>
|
||||
require("./AssetSourceGenerator")
|
||||
);
|
||||
const getAssetBytesGenerator = memoize(() => require("./AssetBytesGenerator"));
|
||||
|
||||
const type = ASSET_MODULE_TYPE;
|
||||
const PLUGIN_NAME = "AssetModulesPlugin";
|
||||
@@ -95,11 +94,6 @@ class AssetModulesPlugin {
|
||||
.for(ASSET_MODULE_TYPE)
|
||||
.tap(PLUGIN_NAME, (parserOptions) => {
|
||||
validateParserOptions(parserOptions);
|
||||
parserOptions = cleverMerge(
|
||||
/** @type {AssetParserOptions} */
|
||||
(compiler.options.module.parser.asset),
|
||||
parserOptions
|
||||
);
|
||||
|
||||
let dataUrlCondition = parserOptions.dataUrlCondition;
|
||||
if (!dataUrlCondition || typeof dataUrlCondition === "object") {
|
||||
@@ -134,6 +128,13 @@ class AssetModulesPlugin {
|
||||
|
||||
return new AssetSourceParser();
|
||||
});
|
||||
normalModuleFactory.hooks.createParser
|
||||
.for(ASSET_MODULE_TYPE_BYTES)
|
||||
.tap(PLUGIN_NAME, (_parserOptions) => {
|
||||
const AssetBytesParser = getAssetBytesParser();
|
||||
|
||||
return new AssetBytesParser();
|
||||
});
|
||||
|
||||
for (const type of [
|
||||
ASSET_MODULE_TYPE,
|
||||
@@ -186,6 +187,14 @@ class AssetModulesPlugin {
|
||||
return new AssetSourceGenerator(compilation.moduleGraph);
|
||||
});
|
||||
|
||||
normalModuleFactory.hooks.createGenerator
|
||||
.for(ASSET_MODULE_TYPE_BYTES)
|
||||
.tap(PLUGIN_NAME, () => {
|
||||
const AssetBytesGenerator = getAssetBytesGenerator();
|
||||
|
||||
return new AssetBytesGenerator(compilation.moduleGraph);
|
||||
});
|
||||
|
||||
compilation.hooks.renderManifest.tap(PLUGIN_NAME, (result, options) => {
|
||||
const { chunkGraph } = compilation;
|
||||
const { chunk, codeGenerationResults, runtimeTemplate } = options;
|
||||
@@ -245,10 +254,15 @@ class AssetModulesPlugin {
|
||||
entryInfo = assetInfo;
|
||||
entryHash = fullContentHash;
|
||||
} else {
|
||||
entryFilename = buildInfo.filename || data.get("filename");
|
||||
entryInfo = buildInfo.assetInfo || data.get("assetInfo");
|
||||
entryFilename =
|
||||
/** @type {string} */
|
||||
(buildInfo.filename || data.get("filename"));
|
||||
entryInfo =
|
||||
/** @type {AssetInfo} */
|
||||
(buildInfo.assetInfo || data.get("assetInfo"));
|
||||
entryHash =
|
||||
buildInfo.fullContentHash || data.get("fullContentHash");
|
||||
/** @type {string} */
|
||||
(buildInfo.fullContentHash || data.get("fullContentHash"));
|
||||
}
|
||||
|
||||
result.push({
|
||||
@@ -280,10 +294,14 @@ class AssetModulesPlugin {
|
||||
const data =
|
||||
/** @type {NonNullable<CodeGenerationResult["data"]>} */
|
||||
(codeGenerationResult.data);
|
||||
context.assets.set(data.get("filename"), {
|
||||
source,
|
||||
info: data.get("assetInfo")
|
||||
});
|
||||
context.assets.set(
|
||||
/** @type {string} */
|
||||
(data.get("filename")),
|
||||
{
|
||||
source,
|
||||
info: data.get("assetInfo")
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
10
node_modules/webpack/lib/asset/AssetParser.js
generated
vendored
10
node_modules/webpack/lib/asset/AssetParser.js
generated
vendored
@@ -33,15 +33,19 @@ class AssetParser extends Parser {
|
||||
throw new Error("AssetParser doesn't accept preparsed AST");
|
||||
}
|
||||
|
||||
const buildInfo = /** @type {BuildInfo} */ (state.module.buildInfo);
|
||||
const buildInfo =
|
||||
/** @type {BuildInfo} */
|
||||
(state.module.buildInfo);
|
||||
buildInfo.strict = true;
|
||||
const buildMeta = /** @type {BuildMeta} */ (state.module.buildMeta);
|
||||
const buildMeta =
|
||||
/** @type {BuildMeta} */
|
||||
(state.module.buildMeta);
|
||||
buildMeta.exportsType = "default";
|
||||
buildMeta.defaultObject = false;
|
||||
|
||||
if (typeof this.dataUrlCondition === "function") {
|
||||
buildInfo.dataUrl = this.dataUrlCondition(source, {
|
||||
filename: state.module.matchResource || state.module.resource,
|
||||
filename: /** @type {string} */ (state.module.getResource()),
|
||||
module: state.module
|
||||
});
|
||||
} else if (typeof this.dataUrlCondition === "boolean") {
|
||||
|
||||
2
node_modules/webpack/lib/asset/AssetSourceGenerator.js
generated
vendored
2
node_modules/webpack/lib/asset/AssetSourceGenerator.js
generated
vendored
@@ -60,7 +60,7 @@ class AssetSourceGenerator extends Generator {
|
||||
concatenationScope.registerNamespaceExport(
|
||||
ConcatenationScope.NAMESPACE_OBJECT_EXPORT
|
||||
);
|
||||
sourceContent = `${runtimeTemplate.supportsConst() ? "const" : "var"} ${
|
||||
sourceContent = `${runtimeTemplate.renderConst()} ${
|
||||
ConcatenationScope.NAMESPACE_OBJECT_EXPORT
|
||||
} = ${JSON.stringify(encodedSource)};`;
|
||||
} else {
|
||||
|
||||
5
node_modules/webpack/lib/asset/RawDataUrlModule.js
generated
vendored
5
node_modules/webpack/lib/asset/RawDataUrlModule.js
generated
vendored
@@ -12,10 +12,11 @@ const { ASSET_MODULE_TYPE_RAW_DATA_URL } = require("../ModuleTypeConstants");
|
||||
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||
const makeSerializable = require("../util/makeSerializable");
|
||||
|
||||
/** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */
|
||||
/** @typedef {import("../config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
|
||||
/** @typedef {import("../Compilation")} Compilation */
|
||||
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
|
||||
/** @typedef {import("../Module").BuildCallback} BuildCallback */
|
||||
/** @typedef {import("../Module").RuntimeRequirements} RuntimeRequirements */
|
||||
/** @typedef {import("../Module").CodeGenerationContext} CodeGenerationContext */
|
||||
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
|
||||
/** @typedef {import("../Module").NeedBuildCallback} NeedBuildCallback */
|
||||
@@ -23,7 +24,6 @@ const makeSerializable = require("../util/makeSerializable");
|
||||
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
||||
/** @typedef {import("../RequestShortener")} RequestShortener */
|
||||
/** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */
|
||||
/** @typedef {import("../WebpackError")} WebpackError */
|
||||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
||||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
||||
/** @typedef {import("../util/Hash")} Hash */
|
||||
@@ -120,6 +120,7 @@ class RawDataUrlModule extends Module {
|
||||
data.set("url", {
|
||||
javascript: this.url
|
||||
});
|
||||
/** @type {RuntimeRequirements} */
|
||||
const runtimeRequirements = new Set();
|
||||
runtimeRequirements.add(RuntimeGlobals.module);
|
||||
return { sources, runtimeRequirements, data };
|
||||
|
||||
Reference in New Issue
Block a user