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:
242
node_modules/webpack/lib/optimize/ConcatenatedModule.js
generated
vendored
242
node_modules/webpack/lib/optimize/ConcatenatedModule.js
generated
vendored
@@ -23,6 +23,7 @@ const Template = require("../Template");
|
||||
const { DEFAULTS } = require("../config/defaults");
|
||||
const HarmonyImportDependency = require("../dependencies/HarmonyImportDependency");
|
||||
const HarmonyImportSideEffectDependency = require("../dependencies/HarmonyImportSideEffectDependency");
|
||||
const HarmonyImportSpecifierDependency = require("../dependencies/HarmonyImportSpecifierDependency");
|
||||
const JavascriptParser = require("../javascript/JavascriptParser");
|
||||
const {
|
||||
getMakeDeferredNamespaceModeFromExportsType,
|
||||
@@ -57,33 +58,31 @@ const {
|
||||
/** @typedef {import("eslint-scope").Scope} Scope */
|
||||
/** @typedef {import("eslint-scope").Variable} Variable */
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */
|
||||
/** @typedef {import("../config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
|
||||
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
||||
/** @typedef {import("../CodeGenerationResults")} CodeGenerationResults */
|
||||
/** @typedef {import("../Compilation")} Compilation */
|
||||
/** @typedef {import("../Dependency")} Dependency */
|
||||
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
|
||||
/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
|
||||
/** @typedef {import("../DependencyTemplates")} DependencyTemplates */
|
||||
/** @typedef {import("../ExportsInfo").ExportInfo} ExportInfo */
|
||||
/** @typedef {import("../ExternalModule")} ExternalModule */
|
||||
/** @typedef {import("../Module").BuildCallback} BuildCallback */
|
||||
/** @typedef {import("../Module").BuildInfo} BuildInfo */
|
||||
/** @typedef {import("../Module").FileSystemDependencies} FileSystemDependencies */
|
||||
/** @typedef {import("../Module").BuildMeta} BuildMeta */
|
||||
/** @typedef {import("../Module").CodeGenerationContext} CodeGenerationContext */
|
||||
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
|
||||
/** @typedef {import("../Module").LibIdentOptions} LibIdentOptions */
|
||||
/** @typedef {import("../Module").LibIdent} LibIdent */
|
||||
/** @typedef {import("../Module").NameForCondition} NameForCondition */
|
||||
/** @typedef {import("../Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
|
||||
/** @typedef {import("../Module").RuntimeRequirements} RuntimeRequirements */
|
||||
/** @typedef {import("../Module").SourceTypes} SourceTypes */
|
||||
/** @typedef {import("../ModuleGraph")} ModuleGraph */
|
||||
/** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
|
||||
/** @typedef {import("../ModuleGraphConnection").ConnectionState} ConnectionState */
|
||||
/** @typedef {import("../ModuleParseError")} ModuleParseError */
|
||||
/** @typedef {import("../RequestShortener")} RequestShortener */
|
||||
/** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */
|
||||
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
||||
/** @typedef {import("../WebpackError")} WebpackError */
|
||||
/** @typedef {import("../javascript/JavascriptModulesPlugin").ChunkRenderContext} ChunkRenderContext */
|
||||
/** @typedef {import("../javascript/JavascriptParser").Program} Program */
|
||||
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
|
||||
@@ -91,7 +90,6 @@ const {
|
||||
/** @typedef {import("../util/Hash")} Hash */
|
||||
/** @typedef {typeof import("../util/Hash")} HashConstructor */
|
||||
/** @typedef {import("../util/concatenate").ScopeInfo} ScopeInfo */
|
||||
/** @typedef {import("../util/concatenate").UsedNames} UsedNames */
|
||||
/** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */
|
||||
/** @typedef {import("../util/identifier").AssociatedObjectForCache} AssociatedObjectForCache */
|
||||
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
|
||||
@@ -107,27 +105,23 @@ const {
|
||||
|
||||
// fix eslint-scope to support class properties correctly
|
||||
// cspell:word Referencer
|
||||
const ReferencerClass = /** @type {EXPECTED_ANY} */ (Referencer);
|
||||
const ReferencerClass = Referencer;
|
||||
if (!ReferencerClass.prototype.PropertyDefinition) {
|
||||
ReferencerClass.prototype.PropertyDefinition =
|
||||
ReferencerClass.prototype.Property;
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} ReexportInfo
|
||||
* @property {Module} module
|
||||
* @property {string[]} export
|
||||
*/
|
||||
|
||||
/** @typedef {RawBinding | SymbolBinding} Binding */
|
||||
|
||||
/** @typedef {string[]} ExportName */
|
||||
|
||||
/**
|
||||
* @typedef {object} RawBinding
|
||||
* @property {ModuleInfo} info
|
||||
* @property {string} rawName
|
||||
* @property {string=} comment
|
||||
* @property {string[]} ids
|
||||
* @property {string[]} exportName
|
||||
* @property {ExportName} ids
|
||||
* @property {ExportName} exportName
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -135,8 +129,8 @@ if (!ReferencerClass.prototype.PropertyDefinition) {
|
||||
* @property {ConcatenatedModuleInfo} info
|
||||
* @property {string} name
|
||||
* @property {string=} comment
|
||||
* @property {string[]} ids
|
||||
* @property {string[]} exportName
|
||||
* @property {ExportName} ids
|
||||
* @property {ExportName} exportName
|
||||
*/
|
||||
|
||||
/** @typedef {ConcatenatedModuleInfo | ExternalModuleInfo } ModuleInfo */
|
||||
@@ -238,6 +232,8 @@ const moveDeferToLast = (
|
||||
return -1;
|
||||
};
|
||||
|
||||
const INITIAL_USED_NAMES = new Set(RESERVED_NAMES);
|
||||
|
||||
/**
|
||||
* @param {Iterable<string>} iterable iterable object
|
||||
* @returns {string} joined iterable object
|
||||
@@ -265,15 +261,19 @@ const joinIterableWithComma = (iterable) => {
|
||||
* @property {RuntimeSpec | boolean} runtimeCondition
|
||||
*/
|
||||
|
||||
/** @typedef {Set<ConcatenatedModuleInfo>} NeededNamespaceObjects */
|
||||
|
||||
/** @typedef {Map<Module, ModuleInfo>} ModuleToInfoMap */
|
||||
|
||||
/**
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
* @param {ModuleInfo} info module info
|
||||
* @param {string[]} exportName exportName
|
||||
* @param {Map<Module, ModuleInfo>} moduleToInfoMap moduleToInfoMap
|
||||
* @param {ExportName} exportName exportName
|
||||
* @param {ModuleToInfoMap} moduleToInfoMap moduleToInfoMap
|
||||
* @param {RuntimeSpec} runtime for which runtime
|
||||
* @param {RequestShortener} requestShortener the request shortener
|
||||
* @param {RuntimeTemplate} runtimeTemplate the runtime template
|
||||
* @param {Set<ConcatenatedModuleInfo>} neededNamespaceObjects modules for which a namespace object should be generated
|
||||
* @param {NeededNamespaceObjects} neededNamespaceObjects modules for which a namespace object should be generated
|
||||
* @param {boolean} asCall asCall
|
||||
* @param {boolean} depDeferred the dependency is deferred
|
||||
* @param {boolean | undefined} strictHarmonyModule strictHarmonyModule
|
||||
@@ -477,7 +477,7 @@ const getFinalBinding = (
|
||||
}
|
||||
const directExport = info.exportMap && info.exportMap.get(exportId);
|
||||
if (directExport) {
|
||||
const usedName = /** @type {string[]} */ (
|
||||
const usedName = /** @type {ExportName} */ (
|
||||
exportsInfo.getUsedName(exportName, runtime)
|
||||
);
|
||||
if (!usedName) {
|
||||
@@ -540,7 +540,7 @@ const getFinalBinding = (
|
||||
);
|
||||
}
|
||||
if (info.namespaceExportSymbol) {
|
||||
const usedName = /** @type {string[]} */ (
|
||||
const usedName = /** @type {ExportName} */ (
|
||||
exportsInfo.getUsedName(exportName, runtime)
|
||||
);
|
||||
return {
|
||||
@@ -558,7 +558,7 @@ const getFinalBinding = (
|
||||
}
|
||||
|
||||
case "external": {
|
||||
const used = /** @type {string[]} */ (
|
||||
const used = /** @type {ExportName} */ (
|
||||
exportsInfo.getUsedName(exportName, runtime)
|
||||
);
|
||||
if (!used) {
|
||||
@@ -588,12 +588,12 @@ const getFinalBinding = (
|
||||
/**
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
* @param {ModuleInfo} info module info
|
||||
* @param {string[]} exportName exportName
|
||||
* @param {Map<Module, ModuleInfo>} moduleToInfoMap moduleToInfoMap
|
||||
* @param {ExportName} exportName exportName
|
||||
* @param {ModuleToInfoMap} moduleToInfoMap moduleToInfoMap
|
||||
* @param {RuntimeSpec} runtime for which runtime
|
||||
* @param {RequestShortener} requestShortener the request shortener
|
||||
* @param {RuntimeTemplate} runtimeTemplate the runtime template
|
||||
* @param {Set<ConcatenatedModuleInfo>} neededNamespaceObjects modules for which a namespace object should be generated
|
||||
* @param {NeededNamespaceObjects} neededNamespaceObjects modules for which a namespace object should be generated
|
||||
* @param {boolean} asCall asCall
|
||||
* @param {boolean} depDeferred the dependency is deferred
|
||||
* @param {boolean | undefined} callContext callContext
|
||||
@@ -672,6 +672,8 @@ const getFinalName = (
|
||||
* @property {SyncBailHook<[Partial<ConcatenatedModuleInfo>, ConcatenatedModuleInfo], boolean | void>} concatenatedModuleInfo
|
||||
*/
|
||||
|
||||
/** @typedef {BuildInfo["topLevelDeclarations"]} TopLevelDeclarations */
|
||||
|
||||
/** @type {WeakMap<Compilation, ConcatenateModuleHooks>} */
|
||||
const compilationHooksMap = new WeakMap();
|
||||
|
||||
@@ -747,7 +749,7 @@ class ConcatenatedModule extends Module {
|
||||
this._modules = modules;
|
||||
this._runtime = runtime;
|
||||
this.factoryMeta = rootModule && rootModule.factoryMeta;
|
||||
/** @type {Compilation | undefined} */
|
||||
/** @type {Compilation} */
|
||||
this.compilation = compilation;
|
||||
}
|
||||
|
||||
@@ -792,14 +794,14 @@ class ConcatenatedModule extends Module {
|
||||
|
||||
/**
|
||||
* @param {LibIdentOptions} options options
|
||||
* @returns {string | null} an identifier for library inclusion
|
||||
* @returns {LibIdent | null} an identifier for library inclusion
|
||||
*/
|
||||
libIdent(options) {
|
||||
return this.rootModule.libIdent(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string | null} absolute path which should be used for condition matching (usually the resource path)
|
||||
* @returns {NameForCondition | null} absolute path which should be used for condition matching (usually the resource path)
|
||||
*/
|
||||
nameForCondition() {
|
||||
return this.rootModule.nameForCondition();
|
||||
@@ -831,13 +833,9 @@ class ConcatenatedModule extends Module {
|
||||
cacheable: true,
|
||||
moduleArgument,
|
||||
exportsArgument,
|
||||
/** @type {LazySet<string>} */
|
||||
fileDependencies: new LazySet(),
|
||||
/** @type {LazySet<string>} */
|
||||
contextDependencies: new LazySet(),
|
||||
/** @type {LazySet<string>} */
|
||||
missingDependencies: new LazySet(),
|
||||
/** @type {Set<string>} */
|
||||
topLevelDeclarations: new Set(),
|
||||
assets: undefined
|
||||
};
|
||||
@@ -884,7 +882,7 @@ class ConcatenatedModule extends Module {
|
||||
}
|
||||
}
|
||||
|
||||
const { assets, assetsInfo, topLevelDeclarations } =
|
||||
const { assets, assetsInfo, topLevelDeclarations, needCreateRequire } =
|
||||
/** @type {BuildInfo} */ (m.buildInfo);
|
||||
|
||||
const buildInfo = /** @type {BuildInfo} */ (this.buildInfo);
|
||||
@@ -901,6 +899,11 @@ class ConcatenatedModule extends Module {
|
||||
buildInfo.topLevelDeclarations = undefined;
|
||||
}
|
||||
|
||||
// populate needCreateRequire
|
||||
if (needCreateRequire) {
|
||||
this.buildInfo.needCreateRequire = true;
|
||||
}
|
||||
|
||||
// populate assets
|
||||
if (assets) {
|
||||
if (buildInfo.assets === undefined) {
|
||||
@@ -950,9 +953,7 @@ class ConcatenatedModule extends Module {
|
||||
const list = [];
|
||||
/** @type {Map<Module, RuntimeSpec | true>} */
|
||||
const existingEntries = new Map();
|
||||
const deferEnabled =
|
||||
/** @type {Compilation} */
|
||||
(this.compilation).options.experiments.deferImport;
|
||||
const deferEnabled = this.compilation.options.experiments.deferImport;
|
||||
|
||||
/**
|
||||
* @param {Module} module a module
|
||||
@@ -966,7 +967,7 @@ class ConcatenatedModule extends Module {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @type {Array<{ connection: ModuleGraphConnection, sourceOrder: number, rangeStart: number, defer?: boolean }>}
|
||||
* @type {{ connection: ModuleGraphConnection, sourceOrder: number, rangeStart: number | undefined, defer?: boolean }[]}
|
||||
*/
|
||||
const references = connections
|
||||
.filter((connection) => {
|
||||
@@ -981,9 +982,9 @@ class ConcatenatedModule extends Module {
|
||||
);
|
||||
})
|
||||
.map((connection) => {
|
||||
const dep = /** @type {HarmonyImportDependency} */ (
|
||||
connection.dependency
|
||||
);
|
||||
const dep =
|
||||
/** @type {HarmonyImportDependency} */
|
||||
(connection.dependency);
|
||||
return {
|
||||
connection,
|
||||
sourceOrder: dep.sourceOrder,
|
||||
@@ -1154,10 +1155,10 @@ class ConcatenatedModule extends Module {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {LazySet<string>} fileDependencies set where file dependencies are added to
|
||||
* @param {LazySet<string>} contextDependencies set where context dependencies are added to
|
||||
* @param {LazySet<string>} missingDependencies set where missing dependencies are added to
|
||||
* @param {LazySet<string>} buildDependencies set where build dependencies are added to
|
||||
* @param {FileSystemDependencies} fileDependencies set where file dependencies are added to
|
||||
* @param {FileSystemDependencies} contextDependencies set where context dependencies are added to
|
||||
* @param {FileSystemDependencies} missingDependencies set where missing dependencies are added to
|
||||
* @param {FileSystemDependencies} buildDependencies set where build dependencies are added to
|
||||
*/
|
||||
addCacheDependencies(
|
||||
fileDependencies,
|
||||
@@ -1188,7 +1189,7 @@ class ConcatenatedModule extends Module {
|
||||
codeGenerationResults
|
||||
}) {
|
||||
const { concatenatedModuleInfo } = ConcatenatedModule.getCompilationHooks(
|
||||
/** @type {Compilation} */ (this.compilation)
|
||||
this.compilation
|
||||
);
|
||||
|
||||
/** @type {RuntimeRequirements} */
|
||||
@@ -1203,11 +1204,21 @@ class ConcatenatedModule extends Module {
|
||||
);
|
||||
|
||||
// Set with modules that need a generated namespace object
|
||||
/** @type {Set<ConcatenatedModuleInfo>} */
|
||||
/** @type {NeededNamespaceObjects} */
|
||||
const neededNamespaceObjects = new Set();
|
||||
|
||||
// List of all used names to avoid conflicts
|
||||
const allUsedNames = new Set(RESERVED_NAMES);
|
||||
// Default disallowed names
|
||||
const allUsedNames = new Set(INITIAL_USED_NAMES);
|
||||
const chunks = chunkGraph.getModuleChunks(this);
|
||||
|
||||
// Add names already used in the current chunk scope
|
||||
for (const chunk of chunks) {
|
||||
if (ConcatenationScope.chunkUsedNames.has(chunk)) {
|
||||
for (const name of ConcatenationScope.chunkUsedNames.get(chunk) || []) {
|
||||
allUsedNames.add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate source code and analyse scopes
|
||||
// Prepare a ReplaceSource for the final source
|
||||
@@ -1226,8 +1237,25 @@ class ConcatenatedModule extends Module {
|
||||
);
|
||||
}
|
||||
|
||||
// Record the names registered by the current ConcatenatedModule into the chunk scope
|
||||
if (INITIAL_USED_NAMES.size !== allUsedNames.size) {
|
||||
for (const name of allUsedNames) {
|
||||
if (INITIAL_USED_NAMES.has(name)) continue;
|
||||
|
||||
for (const chunk of chunks) {
|
||||
if (!ConcatenationScope.chunkUsedNames.has(chunk)) {
|
||||
ConcatenationScope.chunkUsedNames.set(chunk, new Set([name]));
|
||||
} else {
|
||||
/** @type {Set<string>} */ (
|
||||
ConcatenationScope.chunkUsedNames.get(chunk)
|
||||
).add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Updated Top level declarations are created by renaming
|
||||
/** @type {Set<string>} */
|
||||
/** @type {TopLevelDeclarations} */
|
||||
const topLevelDeclarations = new Set();
|
||||
|
||||
// List of additional names in scope for module references
|
||||
@@ -1683,9 +1711,11 @@ class ConcatenatedModule extends Module {
|
||||
|
||||
// add harmony compatibility flag (must be first because of possible circular dependencies)
|
||||
let shouldAddHarmonyFlag = false;
|
||||
const rootExportsInfo = moduleGraph.getExportsInfo(this);
|
||||
if (
|
||||
moduleGraph.getExportsInfo(this).otherExportsInfo.getUsed(runtime) !==
|
||||
UsageState.Unused
|
||||
rootExportsInfo.otherExportsInfo.getUsed(runtime) !== UsageState.Unused ||
|
||||
rootExportsInfo.getReadOnlyExportInfo("__esModule").getUsed(runtime) !==
|
||||
UsageState.Unused
|
||||
) {
|
||||
shouldAddHarmonyFlag = true;
|
||||
}
|
||||
@@ -1702,10 +1732,7 @@ class ConcatenatedModule extends Module {
|
||||
}
|
||||
|
||||
const { onDemandExportsGeneration } =
|
||||
ConcatenatedModule.getCompilationHooks(
|
||||
/** @type {Compilation} */
|
||||
(this.compilation)
|
||||
);
|
||||
ConcatenatedModule.getCompilationHooks(this.compilation);
|
||||
|
||||
runtimeRequirements.add(RuntimeGlobals.exports);
|
||||
runtimeRequirements.add(RuntimeGlobals.definePropertyGetters);
|
||||
@@ -1806,13 +1833,30 @@ ${defineGetters}`
|
||||
if (!source) continue;
|
||||
result.add(source);
|
||||
}
|
||||
|
||||
if (info.type === "external" && info.deferred) {
|
||||
const moduleId = JSON.stringify(chunkGraph.getModuleId(info.module));
|
||||
const loader = getOptimizedDeferredModule(
|
||||
runtimeTemplate,
|
||||
info.module.getExportsType(
|
||||
moduleGraph,
|
||||
/** @type {BuildMeta} */
|
||||
(this.rootModule.buildMeta).strictHarmonyModule
|
||||
),
|
||||
moduleId,
|
||||
// an async module will opt-out of the concat module optimization.
|
||||
[]
|
||||
);
|
||||
runtimeRequirements.add(RuntimeGlobals.require);
|
||||
result.add(
|
||||
`\n// DEFERRED EXTERNAL MODULE: ${info.module.readableIdentifier(requestShortener)}\nvar ${info.deferredName} = ${loader};`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/** @type {InitFragment<ChunkRenderContext>[]} */
|
||||
const chunkInitFragments = [];
|
||||
const deferEnabled =
|
||||
/** @type {Compilation} */
|
||||
(this.compilation).options.experiments.deferImport;
|
||||
const deferEnabled = this.compilation.options.experiments.deferImport;
|
||||
|
||||
// evaluate modules in order
|
||||
for (const rawInfo of modulesWithInfo) {
|
||||
@@ -1830,11 +1874,20 @@ ${defineGetters}`
|
||||
if (deferEnabled) {
|
||||
for (const dep of info.module.dependencies) {
|
||||
if (
|
||||
!dep.defer &&
|
||||
dep instanceof HarmonyImportSideEffectDependency
|
||||
!(/** @type {HarmonyImportDependency} */ (dep).defer) &&
|
||||
(dep instanceof HarmonyImportSideEffectDependency ||
|
||||
dep instanceof HarmonyImportSpecifierDependency)
|
||||
) {
|
||||
const referredModule = moduleGraph.getModule(dep);
|
||||
if (!referredModule) continue;
|
||||
if (!referredModule) {
|
||||
if (dep instanceof HarmonyImportSideEffectDependency) {
|
||||
continue;
|
||||
} else {
|
||||
throw new Error(
|
||||
"Deferred module used, but no module in the graph."
|
||||
);
|
||||
}
|
||||
}
|
||||
if (moduleGraph.isDeferred(referredModule)) {
|
||||
const deferredModuleInfo = /** @type {ExternalModuleInfo} */ (
|
||||
modulesWithInfo.find(
|
||||
@@ -1863,41 +1916,30 @@ ${defineGetters}`
|
||||
break;
|
||||
}
|
||||
case "external": {
|
||||
result.add(
|
||||
`\n// EXTERNAL MODULE: ${info.module.readableIdentifier(
|
||||
requestShortener
|
||||
)}\n`
|
||||
);
|
||||
runtimeRequirements.add(RuntimeGlobals.require);
|
||||
const { runtimeCondition } =
|
||||
/** @type {ExternalModuleInfo | ReferenceToModuleInfo} */
|
||||
(rawInfo);
|
||||
const condition = runtimeTemplate.runtimeConditionExpression({
|
||||
chunkGraph,
|
||||
runtimeCondition,
|
||||
runtime,
|
||||
runtimeRequirements
|
||||
});
|
||||
if (condition !== "true") {
|
||||
isConditional = true;
|
||||
result.add(`if (${condition}) {\n`);
|
||||
}
|
||||
const moduleId = JSON.stringify(chunkGraph.getModuleId(info.module));
|
||||
if (info.deferred) {
|
||||
const loader = getOptimizedDeferredModule(
|
||||
runtimeTemplate,
|
||||
info.module.getExportsType(
|
||||
moduleGraph,
|
||||
/** @type {BuildMeta} */
|
||||
(this.rootModule.buildMeta).strictHarmonyModule
|
||||
),
|
||||
moduleId,
|
||||
// an async module will opt-out of the concat module optimization.
|
||||
[]
|
||||
// deferred case is handled in the "const info of modulesWithInfo" loop above
|
||||
if (!info.deferred) {
|
||||
result.add(
|
||||
`\n// EXTERNAL MODULE: ${info.module.readableIdentifier(
|
||||
requestShortener
|
||||
)}\n`
|
||||
);
|
||||
runtimeRequirements.add(RuntimeGlobals.require);
|
||||
const { runtimeCondition } =
|
||||
/** @type {ExternalModuleInfo | ReferenceToModuleInfo} */
|
||||
(rawInfo);
|
||||
const condition = runtimeTemplate.runtimeConditionExpression({
|
||||
chunkGraph,
|
||||
runtimeCondition,
|
||||
runtime,
|
||||
runtimeRequirements
|
||||
});
|
||||
if (condition !== "true") {
|
||||
isConditional = true;
|
||||
result.add(`if (${condition}) {\n`);
|
||||
}
|
||||
const moduleId = JSON.stringify(
|
||||
chunkGraph.getModuleId(info.module)
|
||||
);
|
||||
result.add(`var ${info.deferredName} = ${loader};`);
|
||||
name = info.deferredName;
|
||||
} else {
|
||||
result.add(`var ${info.name} = __webpack_require__(${moduleId});`);
|
||||
name = info.name;
|
||||
}
|
||||
@@ -1959,7 +2001,7 @@ ${defineGetters}`
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Map<Module, ModuleInfo>} modulesMap modulesMap
|
||||
* @param {ModuleToInfoMap} modulesMap modulesMap
|
||||
* @param {ModuleInfo} info info
|
||||
* @param {DependencyTemplates} dependencyTemplates dependencyTemplates
|
||||
* @param {RuntimeTemplate} runtimeTemplate runtimeTemplate
|
||||
@@ -2061,7 +2103,7 @@ ${defineGetters}`
|
||||
/**
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
* @param {RuntimeSpec} runtime the runtime
|
||||
* @returns {[ModuleInfoOrReference[], Map<Module, ModuleInfo>]} module info items
|
||||
* @returns {[ModuleInfoOrReference[], ModuleToInfoMap]} module info items
|
||||
*/
|
||||
_getModulesWithInfo(moduleGraph, runtime) {
|
||||
const orderedConcatenationList = this._createConcatenationList(
|
||||
@@ -2070,7 +2112,7 @@ ${defineGetters}`
|
||||
runtime,
|
||||
moduleGraph
|
||||
);
|
||||
/** @type {Map<Module, ModuleInfo>} */
|
||||
/** @type {ModuleToInfoMap} */
|
||||
const map = new Map();
|
||||
const list = orderedConcatenationList.map((info, index) => {
|
||||
let item = map.get(info.module);
|
||||
|
||||
Reference in New Issue
Block a user