Fix code quality violations and enhance ROUTE-EXISTS-01 rule
Implement JQHTML function cache ID system and fix bundle compilation Implement underscore prefix for system tables Fix JS syntax linter to support decorators and grant exception to Task system SPA: Update planning docs and wishlists with remaining features SPA: Document Navigation API abandonment and future enhancements Implement SPA browser integration with History API (Phase 1) Convert contacts view page to SPA action Convert clients pages to SPA actions and document conversion procedure SPA: Merge GET parameters and update documentation Implement SPA route URL generation in JavaScript and PHP Implement SPA bootstrap controller architecture Add SPA routing manual page (rsx:man spa) Add SPA routing documentation to CLAUDE.md Phase 4 Complete: Client-side SPA routing implementation Update get_routes() consumers for unified route structure Complete SPA Phase 3: PHP-side route type detection and is_spa flag Restore unified routes structure and Manifest_Query class Refactor route indexing and add SPA infrastructure Phase 3 Complete: SPA route registration in manifest Implement SPA Phase 2: Extract router code and test decorators Rename Jqhtml_Component to Component and complete SPA foundation setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
0
node_modules/webpack/lib/APIPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/APIPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AbstractMethodError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AbstractMethodError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AsyncDependenciesBlock.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AsyncDependenciesBlock.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AsyncDependencyToInitialChunkError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AsyncDependencyToInitialChunkError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AutomaticPrefetchPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/AutomaticPrefetchPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/BannerPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/BannerPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Cache.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Cache.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CacheFacade.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CacheFacade.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CaseSensitiveModulesWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CaseSensitiveModulesWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Chunk.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Chunk.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkGraph.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkGraph.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkGroup.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkGroup.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkRenderError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkRenderError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkTemplate.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ChunkTemplate.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CleanPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CleanPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CodeGenerationError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CodeGenerationError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CodeGenerationResults.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CodeGenerationResults.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CommentCompilationWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/CommentCompilationWarning.js
generated
vendored
Executable file → Normal file
27
node_modules/webpack/lib/CompatibilityPlugin.js
generated
vendored
Executable file → Normal file
27
node_modules/webpack/lib/CompatibilityPlugin.js
generated
vendored
Executable file → Normal file
@@ -147,13 +147,13 @@ class CompatibilityPlugin {
|
||||
range: /** @type {Range} */ (pattern.range)
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
parser.hooks.pattern
|
||||
.for(RuntimeGlobals.exports)
|
||||
.tap(PLUGIN_NAME, (pattern) => {
|
||||
const newName = "__nested_webpack_exports__";
|
||||
parser.tagVariable(pattern.name, nestedWebpackIdentifierTag, {
|
||||
name: "__nested_webpack_exports__",
|
||||
name: newName,
|
||||
declaration: {
|
||||
updated: false,
|
||||
loc: /** @type {DependencyLocation} */ (pattern.loc),
|
||||
@@ -162,6 +162,28 @@ class CompatibilityPlugin {
|
||||
});
|
||||
return true;
|
||||
});
|
||||
// Update single `var __webpack_require__ = {};` and `var __webpack_exports__ = {};` without expression
|
||||
parser.hooks.declarator.tap(PLUGIN_NAME, (declarator) => {
|
||||
if (
|
||||
declarator.id.type === "Identifier" &&
|
||||
(declarator.id.name === RuntimeGlobals.exports ||
|
||||
declarator.id.name === RuntimeGlobals.require)
|
||||
) {
|
||||
const { name, declaration } =
|
||||
/** @type {CompatibilitySettings} */ (
|
||||
parser.getTagData(
|
||||
declarator.id.name,
|
||||
nestedWebpackIdentifierTag
|
||||
)
|
||||
);
|
||||
if (!declaration.updated) {
|
||||
const dep = new ConstDependency(name, declaration.range);
|
||||
dep.loc = declaration.loc;
|
||||
parser.state.module.addPresentationalDependency(dep);
|
||||
declaration.updated = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
parser.hooks.expression
|
||||
.for(nestedWebpackIdentifierTag)
|
||||
.tap(PLUGIN_NAME, (expr) => {
|
||||
@@ -212,3 +234,4 @@ class CompatibilityPlugin {
|
||||
}
|
||||
|
||||
module.exports = CompatibilityPlugin;
|
||||
module.exports.nestedWebpackIdentifierTag = nestedWebpackIdentifierTag;
|
||||
|
||||
27
node_modules/webpack/lib/Compilation.js
generated
vendored
Executable file → Normal file
27
node_modules/webpack/lib/Compilation.js
generated
vendored
Executable file → Normal file
@@ -134,6 +134,7 @@ const { isSourceEqual } = require("./util/source");
|
||||
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsModule} StatsModule */
|
||||
/** @typedef {import("./TemplatedPathPlugin").TemplatePath} TemplatePath */
|
||||
/** @typedef {import("./util/Hash")} Hash */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("./util/deprecation").FakeHook<T>} FakeHook<T>
|
||||
@@ -296,6 +297,7 @@ const { isSourceEqual } = require("./util/source");
|
||||
* @property {boolean=} development true, when asset is only used for development and doesn't count towards user-facing assets
|
||||
* @property {boolean=} hotModuleReplacement true, when asset ships data for updating an existing application (HMR)
|
||||
* @property {boolean=} javascriptModule true, when asset is javascript and an ESM
|
||||
* @property {boolean=} manifest true, when file is a manifest
|
||||
* @property {Record<string, null | string | string[]>=} related object of pointers to other assets, keyed by type of relation (only points from parent to child)
|
||||
*/
|
||||
|
||||
@@ -1635,6 +1637,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
||||
_processModuleDependencies(module, callback) {
|
||||
/** @type {{ factory: ModuleFactory, dependencies: Dependency[], context: string | undefined, originModule: Module | null }[]} */
|
||||
const sortedDependencies = [];
|
||||
/** @type {boolean} */
|
||||
const hasLowPriorityDependencies = module.dependencies.some(
|
||||
Dependency.isLowPriorityDependency
|
||||
);
|
||||
|
||||
/** @type {DependenciesBlock} */
|
||||
let currentBlock;
|
||||
@@ -1882,12 +1888,29 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
||||
if (list === undefined) {
|
||||
/** @type {FactoryCacheValue} */
|
||||
(factoryCacheValue).set(cacheKey, (list = []));
|
||||
sortedDependencies.push({
|
||||
const newItem = {
|
||||
factory: factoryCacheKey2,
|
||||
dependencies: list,
|
||||
context: dep.getContext(),
|
||||
originModule: module
|
||||
});
|
||||
};
|
||||
if (hasLowPriorityDependencies) {
|
||||
let insertIndex = sortedDependencies.length;
|
||||
while (insertIndex > 0) {
|
||||
const item = sortedDependencies[insertIndex - 1];
|
||||
const isAllLowPriorityDependencies = item.dependencies.every(
|
||||
Dependency.isLowPriorityDependency
|
||||
);
|
||||
if (isAllLowPriorityDependencies) {
|
||||
insertIndex--;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
sortedDependencies.splice(insertIndex, 0, newItem);
|
||||
} else {
|
||||
sortedDependencies.push(newItem);
|
||||
}
|
||||
}
|
||||
list.push(dep);
|
||||
listCacheKey1 = category;
|
||||
|
||||
0
node_modules/webpack/lib/Compiler.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Compiler.js
generated
vendored
Executable file → Normal file
15
node_modules/webpack/lib/ConcatenationScope.js
generated
vendored
Executable file → Normal file
15
node_modules/webpack/lib/ConcatenationScope.js
generated
vendored
Executable file → Normal file
@@ -112,18 +112,6 @@ class ConcatenationScope {
|
||||
this._currentModule.namespaceExportSymbol = symbol;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} symbol identifier of the export in source code
|
||||
* @returns {boolean} registered success
|
||||
*/
|
||||
registerUsedName(symbol) {
|
||||
if (this.usedNames.has(symbol)) {
|
||||
return false;
|
||||
}
|
||||
this.usedNames.add(symbol);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Module} module the referenced module
|
||||
* @param {Partial<ModuleReferenceOptions>} options options
|
||||
@@ -189,7 +177,4 @@ class ConcatenationScope {
|
||||
ConcatenationScope.DEFAULT_EXPORT = DEFAULT_EXPORT;
|
||||
ConcatenationScope.NAMESPACE_OBJECT_EXPORT = NAMESPACE_OBJECT_EXPORT;
|
||||
|
||||
/** @type {WeakMap<Chunk, Set<string>>} */
|
||||
ConcatenationScope.chunkUsedNames = new WeakMap();
|
||||
|
||||
module.exports = ConcatenationScope;
|
||||
|
||||
0
node_modules/webpack/lib/ConcurrentCompilationError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ConcurrentCompilationError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ConditionalInitFragment.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ConditionalInitFragment.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ConstPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ConstPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextExclusionPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextExclusionPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextModule.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextModule.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextReplacementPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ContextReplacementPlugin.js
generated
vendored
Executable file → Normal file
7
node_modules/webpack/lib/CssModule.js
generated
vendored
Executable file → Normal file
7
node_modules/webpack/lib/CssModule.js
generated
vendored
Executable file → Normal file
@@ -30,9 +30,13 @@ class CssModule extends NormalModule {
|
||||
super(options);
|
||||
|
||||
// Avoid override `layer` for `Module` class, because it is a feature to run module in specific layer
|
||||
/** @type {CSSModuleCreateData['cssLayer']} */
|
||||
this.cssLayer = options.cssLayer;
|
||||
/** @type {CSSModuleCreateData['supports']} */
|
||||
this.supports = options.supports;
|
||||
/** @type {CSSModuleCreateData['media']} */
|
||||
this.media = options.media;
|
||||
/** @type {CSSModuleCreateData['inheritance']} */
|
||||
this.inheritance = options.inheritance;
|
||||
}
|
||||
|
||||
@@ -150,7 +154,8 @@ class CssModule extends NormalModule {
|
||||
cssLayer: /** @type {EXPECTED_ANY} */ (null),
|
||||
supports: /** @type {EXPECTED_ANY} */ (null),
|
||||
media: /** @type {EXPECTED_ANY} */ (null),
|
||||
inheritance: /** @type {EXPECTED_ANY} */ (null)
|
||||
inheritance: /** @type {EXPECTED_ANY} */ (null),
|
||||
extractSourceMap: /** @type {EXPECTED_ANY} */ (null)
|
||||
});
|
||||
obj.deserialize(context);
|
||||
return obj;
|
||||
|
||||
22
node_modules/webpack/lib/DefinePlugin.js
generated
vendored
Executable file → Normal file
22
node_modules/webpack/lib/DefinePlugin.js
generated
vendored
Executable file → Normal file
@@ -354,20 +354,20 @@ class DefinePlugin {
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(compiler) {
|
||||
const definitions = this.definitions;
|
||||
|
||||
/**
|
||||
* @type {Map<string, Set<string>>}
|
||||
*/
|
||||
const finalByNestedKey = new Map();
|
||||
/**
|
||||
* @type {Map<string, Set<string>>}
|
||||
*/
|
||||
const nestedByFinalKey = new Map();
|
||||
|
||||
compiler.hooks.compilation.tap(
|
||||
PLUGIN_NAME,
|
||||
(compilation, { normalModuleFactory }) => {
|
||||
const definitions = this.definitions;
|
||||
|
||||
/**
|
||||
* @type {Map<string, Set<string>>}
|
||||
*/
|
||||
const finalByNestedKey = new Map();
|
||||
/**
|
||||
* @type {Map<string, Set<string>>}
|
||||
*/
|
||||
const nestedByFinalKey = new Map();
|
||||
|
||||
const logger = compilation.getLogger("webpack.DefinePlugin");
|
||||
compilation.dependencyTemplates.set(
|
||||
ConstDependency,
|
||||
|
||||
0
node_modules/webpack/lib/DelegatedModule.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DelegatedModule.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DelegatedModuleFactoryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DelegatedModuleFactoryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DelegatedPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DelegatedPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DependenciesBlock.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DependenciesBlock.js
generated
vendored
Executable file → Normal file
9
node_modules/webpack/lib/Dependency.js
generated
vendored
Executable file → Normal file
9
node_modules/webpack/lib/Dependency.js
generated
vendored
Executable file → Normal file
@@ -19,7 +19,7 @@ const memoize = require("./util/memoize");
|
||||
/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
||||
/** @typedef {import("./util/Hash")} Hash */
|
||||
/** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
|
||||
|
||||
/** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */
|
||||
/**
|
||||
* @typedef {object} UpdateHashContext
|
||||
* @property {ChunkGraph} chunkGraph
|
||||
@@ -360,6 +360,13 @@ Object.defineProperty(Dependency.prototype, "module", {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @param {Dependency} dependency dep
|
||||
* @returns {boolean} true if the dependency is a low priority dependency
|
||||
*/
|
||||
Dependency.isLowPriorityDependency = (dependency) =>
|
||||
/** @type {ModuleDependency} */ (dependency).sourceOrder === Infinity;
|
||||
|
||||
// TODO remove in webpack 6
|
||||
Object.defineProperty(Dependency.prototype, "disconnect", {
|
||||
/**
|
||||
|
||||
1
node_modules/webpack/lib/DependencyTemplate.js
generated
vendored
Executable file → Normal file
1
node_modules/webpack/lib/DependencyTemplate.js
generated
vendored
Executable file → Normal file
@@ -41,6 +41,7 @@
|
||||
/**
|
||||
* @typedef {object} CssDependencyTemplateContextExtras
|
||||
* @property {CssData} cssData the css exports data
|
||||
* @property {string} type the css exports data
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
0
node_modules/webpack/lib/DependencyTemplates.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DependencyTemplates.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllEntryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllEntryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllModule.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllModule.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllReferencePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DllReferencePlugin.js
generated
vendored
Executable file → Normal file
457
node_modules/webpack/lib/DotenvPlugin.js
generated
vendored
Normal file
457
node_modules/webpack/lib/DotenvPlugin.js
generated
vendored
Normal file
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Natsu @xiaoxiaojx
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const FileSystemInfo = require("./FileSystemInfo");
|
||||
const createSchemaValidation = require("./util/create-schema-validation");
|
||||
const { join } = require("./util/fs");
|
||||
|
||||
/** @typedef {import("../declarations/WebpackOptions").DotenvPluginOptions} DotenvPluginOptions */
|
||||
/** @typedef {import("./Compiler")} Compiler */
|
||||
/** @typedef {import("./CacheFacade").ItemCacheFacade} ItemCacheFacade */
|
||||
/** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */
|
||||
/** @typedef {import("./FileSystemInfo").Snapshot} Snapshot */
|
||||
|
||||
/** @typedef {Exclude<DotenvPluginOptions["prefix"], string | undefined>} Prefix */
|
||||
/** @typedef {Record<string, string>} Env */
|
||||
|
||||
/** @type {DotenvPluginOptions} */
|
||||
const DEFAULT_OPTIONS = {
|
||||
prefix: "WEBPACK_",
|
||||
template: [".env", ".env.local", ".env.[mode]", ".env.[mode].local"]
|
||||
};
|
||||
|
||||
// Regex for parsing .env files
|
||||
// ported from https://github.com/motdotla/dotenv/blob/master/lib/main.js#L32
|
||||
const LINE =
|
||||
/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
||||
|
||||
const PLUGIN_NAME = "DotenvPlugin";
|
||||
|
||||
const validate = createSchemaValidation(
|
||||
undefined,
|
||||
() => {
|
||||
const { definitions } = require("../schemas/WebpackOptions.json");
|
||||
|
||||
return {
|
||||
definitions,
|
||||
oneOf: [{ $ref: "#/definitions/DotenvPluginOptions" }]
|
||||
};
|
||||
},
|
||||
{
|
||||
name: "Dotenv Plugin",
|
||||
baseDataPath: "options"
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Parse .env file content
|
||||
* ported from https://github.com/motdotla/dotenv/blob/master/lib/main.js#L49
|
||||
* @param {string | Buffer} src the source content to parse
|
||||
* @returns {Env} parsed environment variables object
|
||||
*/
|
||||
function parse(src) {
|
||||
const obj = /** @type {Env} */ ({});
|
||||
|
||||
// Convert buffer to string
|
||||
let lines = src.toString();
|
||||
|
||||
// Convert line breaks to same format
|
||||
lines = lines.replace(/\r\n?/gm, "\n");
|
||||
|
||||
let match;
|
||||
while ((match = LINE.exec(lines)) !== null) {
|
||||
const key = match[1];
|
||||
|
||||
// Default undefined or null to empty string
|
||||
let value = match[2] || "";
|
||||
|
||||
// Remove whitespace
|
||||
value = value.trim();
|
||||
|
||||
// Check if double quoted
|
||||
const maybeQuote = value[0];
|
||||
|
||||
// Remove surrounding quotes
|
||||
value = value.replace(/^(['"`])([\s\S]*)\1$/gm, "$2");
|
||||
|
||||
// Expand newlines if double quoted
|
||||
if (maybeQuote === '"') {
|
||||
value = value.replace(/\\n/g, "\n");
|
||||
value = value.replace(/\\r/g, "\r");
|
||||
}
|
||||
|
||||
// Add to object
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve escape sequences
|
||||
* ported from https://github.com/motdotla/dotenv-expand
|
||||
* @param {string} value value to resolve
|
||||
* @returns {string} resolved value
|
||||
*/
|
||||
function _resolveEscapeSequences(value) {
|
||||
return value.replace(/\\\$/g, "$");
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand environment variable value
|
||||
* ported from https://github.com/motdotla/dotenv-expand
|
||||
* @param {string} value value to expand
|
||||
* @param {Record<string, string | undefined>} processEnv process.env object
|
||||
* @param {Env} runningParsed running parsed object
|
||||
* @returns {string} expanded value
|
||||
*/
|
||||
function expandValue(value, processEnv, runningParsed) {
|
||||
const env = { ...runningParsed, ...processEnv }; // process.env wins
|
||||
|
||||
const regex = /(?<!\\)\$\{([^{}]+)\}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
||||
|
||||
let result = value;
|
||||
let match;
|
||||
const seen = new Set(); // self-referential checker
|
||||
|
||||
while ((match = regex.exec(result)) !== null) {
|
||||
seen.add(result);
|
||||
|
||||
const [template, bracedExpression, unbracedExpression] = match;
|
||||
const expression = bracedExpression || unbracedExpression;
|
||||
|
||||
// match the operators `:+`, `+`, `:-`, and `-`
|
||||
const opRegex = /(:\+|\+|:-|-)/;
|
||||
// find first match
|
||||
const opMatch = expression.match(opRegex);
|
||||
const splitter = opMatch ? opMatch[0] : null;
|
||||
|
||||
const r = expression.split(/** @type {string} */ (splitter));
|
||||
// const r = splitter ? expression.split(splitter) : [expression];
|
||||
|
||||
let defaultValue;
|
||||
let value;
|
||||
|
||||
const key = r.shift();
|
||||
|
||||
if ([":+", "+"].includes(splitter || "")) {
|
||||
defaultValue = env[key || ""] ? r.join(splitter || "") : "";
|
||||
value = null;
|
||||
} else {
|
||||
defaultValue = r.join(splitter || "");
|
||||
value = env[key || ""];
|
||||
}
|
||||
|
||||
if (value) {
|
||||
// self-referential check
|
||||
result = seen.has(value)
|
||||
? result.replace(template, defaultValue)
|
||||
: result.replace(template, value);
|
||||
} else {
|
||||
result = result.replace(template, defaultValue);
|
||||
}
|
||||
|
||||
// if the result equaled what was in process.env and runningParsed then stop expanding
|
||||
if (result === runningParsed[key || ""]) {
|
||||
break;
|
||||
}
|
||||
|
||||
regex.lastIndex = 0; // reset regex search position to re-evaluate after each replacement
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand environment variables in parsed object
|
||||
* ported from https://github.com/motdotla/dotenv-expand
|
||||
* @param {{ parsed: Env, processEnv: Record<string, string | undefined> }} options expand options
|
||||
* @returns {{ parsed: Env }} expanded options
|
||||
*/
|
||||
function expand(options) {
|
||||
// for use with progressive expansion
|
||||
const runningParsed = /** @type {Env} */ ({});
|
||||
const processEnv = options.processEnv;
|
||||
|
||||
// dotenv.config() ran before this so the assumption is process.env has already been set
|
||||
for (const key in options.parsed) {
|
||||
let value = options.parsed[key];
|
||||
|
||||
// short-circuit scenario: process.env was already set prior to the file value
|
||||
value =
|
||||
processEnv[key] && processEnv[key] !== value
|
||||
? /** @type {string} */ (processEnv[key])
|
||||
: expandValue(value, processEnv, runningParsed);
|
||||
|
||||
const resolvedValue = _resolveEscapeSequences(value);
|
||||
|
||||
options.parsed[key] = resolvedValue;
|
||||
// for use with progressive expansion
|
||||
runningParsed[key] = resolvedValue;
|
||||
}
|
||||
|
||||
// Part of `dotenv-expand` code, but we don't need it because of we don't modify `process.env`
|
||||
// for (const processKey in options.parsed) {
|
||||
// if (processEnv) {
|
||||
// processEnv[processKey] = options.parsed[processKey];
|
||||
// }
|
||||
// }
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format environment variables as DefinePlugin definitions
|
||||
* @param {Env} env environment variables
|
||||
* @returns {Record<string, string>} formatted definitions
|
||||
*/
|
||||
const envToDefinitions = (env) => {
|
||||
const definitions = /** @type {Record<string, string>} */ ({});
|
||||
|
||||
for (const [key, value] of Object.entries(env)) {
|
||||
const defValue = JSON.stringify(value);
|
||||
definitions[`process.env.${key}`] = defValue;
|
||||
definitions[`import.meta.env.${key}`] = defValue;
|
||||
}
|
||||
|
||||
return definitions;
|
||||
};
|
||||
|
||||
class DotenvPlugin {
|
||||
/**
|
||||
* @param {DotenvPluginOptions=} options options object
|
||||
*/
|
||||
constructor(options = {}) {
|
||||
validate(options);
|
||||
this.options = { ...DEFAULT_OPTIONS, ...options };
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Compiler} compiler the compiler instance
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(compiler) {
|
||||
const definePlugin = new compiler.webpack.DefinePlugin({});
|
||||
const prefixes = Array.isArray(this.options.prefix)
|
||||
? this.options.prefix
|
||||
: [this.options.prefix || "WEBPACK_"];
|
||||
/** @type {string | false} */
|
||||
const dir =
|
||||
typeof this.options.dir === "string"
|
||||
? this.options.dir
|
||||
: typeof this.options.dir === "undefined"
|
||||
? compiler.context
|
||||
: this.options.dir;
|
||||
|
||||
/** @type {undefined | Snapshot} */
|
||||
let snapshot;
|
||||
|
||||
const cache = compiler.getCache(PLUGIN_NAME);
|
||||
const identifier = JSON.stringify(this.options.template);
|
||||
const itemCache = cache.getItemCache(identifier, null);
|
||||
|
||||
compiler.hooks.beforeCompile.tapPromise(PLUGIN_NAME, async () => {
|
||||
const { parsed, snapshot: newSnapshot } = dir
|
||||
? await this._loadEnv(compiler, itemCache, dir)
|
||||
: { parsed: {} };
|
||||
const env = this._getEnv(prefixes, parsed);
|
||||
|
||||
definePlugin.definitions = envToDefinitions(env || {});
|
||||
snapshot = newSnapshot;
|
||||
});
|
||||
|
||||
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
||||
if (snapshot) {
|
||||
compilation.fileDependencies.addAll(snapshot.getFileIterable());
|
||||
compilation.missingDependencies.addAll(snapshot.getMissingIterable());
|
||||
}
|
||||
});
|
||||
|
||||
definePlugin.apply(compiler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of env files to load based on mode and template
|
||||
* Similar to Vite's getEnvFilesForMode
|
||||
* @private
|
||||
* @param {InputFileSystem} inputFileSystem the input file system
|
||||
* @param {string | false} dir the directory containing .env files
|
||||
* @param {string | undefined} mode the mode (e.g., 'production', 'development')
|
||||
* @returns {string[]} array of file paths to load
|
||||
*/
|
||||
_getEnvFilesForMode(inputFileSystem, dir, mode) {
|
||||
if (!dir) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const { template } = /** @type {DotenvPluginOptions} */ (this.options);
|
||||
const templates = template || [];
|
||||
|
||||
return templates
|
||||
.map((pattern) => pattern.replace(/\[mode\]/g, mode || "development"))
|
||||
.map((file) => join(inputFileSystem, dir, file));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parsed env variables from `.env` files
|
||||
* @private
|
||||
* @param {InputFileSystem} fs input file system
|
||||
* @param {string} dir dir to load `.env` files
|
||||
* @param {string} mode mode
|
||||
* @returns {Promise<{parsed: Env, fileDependencies: string[], missingDependencies: string[]}>} parsed env variables and dependencies
|
||||
*/
|
||||
async _getParsed(fs, dir, mode) {
|
||||
/** @type {string[]} */
|
||||
const fileDependencies = [];
|
||||
/** @type {string[]} */
|
||||
const missingDependencies = [];
|
||||
|
||||
// Get env files to load
|
||||
const envFiles = this._getEnvFilesForMode(fs, dir, mode);
|
||||
|
||||
// Read all files
|
||||
const contents = await Promise.all(
|
||||
envFiles.map((filePath) =>
|
||||
this._loadFile(fs, filePath).then(
|
||||
(content) => {
|
||||
fileDependencies.push(filePath);
|
||||
return content;
|
||||
},
|
||||
() => {
|
||||
// File doesn't exist, add to missingDependencies (this is normal)
|
||||
missingDependencies.push(filePath);
|
||||
return "";
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Parse all files and merge (later files override earlier ones)
|
||||
// Similar to Vite's implementation
|
||||
const parsed = /** @type {Env} */ ({});
|
||||
|
||||
for (const content of contents) {
|
||||
if (!content) continue;
|
||||
const entries = parse(content);
|
||||
for (const key in entries) {
|
||||
parsed[key] = entries[key];
|
||||
}
|
||||
}
|
||||
|
||||
return { parsed, fileDependencies, missingDependencies };
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Compiler} compiler compiler
|
||||
* @param {ItemCacheFacade} itemCache item cache facade
|
||||
* @param {string} dir directory to read
|
||||
* @returns {Promise<{ parsed: Env, snapshot: Snapshot }>} parsed result and snapshot
|
||||
*/
|
||||
async _loadEnv(compiler, itemCache, dir) {
|
||||
const fs = /** @type {InputFileSystem} */ (compiler.inputFileSystem);
|
||||
const fileSystemInfo = new FileSystemInfo(fs, {
|
||||
unmanagedPaths: compiler.unmanagedPaths,
|
||||
managedPaths: compiler.managedPaths,
|
||||
immutablePaths: compiler.immutablePaths,
|
||||
hashFunction: compiler.options.output.hashFunction
|
||||
});
|
||||
|
||||
const result = await itemCache.getPromise();
|
||||
|
||||
if (result) {
|
||||
const isSnapshotValid = await new Promise((resolve, reject) => {
|
||||
fileSystemInfo.checkSnapshotValid(result.snapshot, (error, isValid) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
resolve(isValid);
|
||||
});
|
||||
});
|
||||
|
||||
if (isSnapshotValid) {
|
||||
return { parsed: result.parsed, snapshot: result.snapshot };
|
||||
}
|
||||
}
|
||||
|
||||
const { parsed, fileDependencies, missingDependencies } =
|
||||
await this._getParsed(
|
||||
fs,
|
||||
dir,
|
||||
/** @type {string} */
|
||||
(compiler.options.mode)
|
||||
);
|
||||
|
||||
const startTime = Date.now();
|
||||
const newSnapshot = await new Promise((resolve, reject) => {
|
||||
fileSystemInfo.createSnapshot(
|
||||
startTime,
|
||||
fileDependencies,
|
||||
null,
|
||||
missingDependencies,
|
||||
// `.env` files are build dependencies
|
||||
compiler.options.snapshot.buildDependencies,
|
||||
(err, snapshot) => {
|
||||
if (err) return reject(err);
|
||||
resolve(snapshot);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
await itemCache.storePromise({ parsed, snapshot: newSnapshot });
|
||||
|
||||
return { parsed, snapshot: newSnapshot };
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate env variables
|
||||
* @private
|
||||
* @param {Prefix} prefixes expose only environment variables that start with these prefixes
|
||||
* @param {Env} parsed parsed env variables
|
||||
* @returns {Env} env variables
|
||||
*/
|
||||
_getEnv(prefixes, parsed) {
|
||||
// Always expand environment variables (like Vite does)
|
||||
// Make a copy of process.env so that dotenv-expand doesn't modify global process.env
|
||||
const processEnv = { ...process.env };
|
||||
expand({ parsed, processEnv });
|
||||
const env = /** @type {Env} */ ({});
|
||||
|
||||
// Get all keys from parser and process.env
|
||||
const keys = [...Object.keys(parsed), ...Object.keys(process.env)];
|
||||
|
||||
// Prioritize actual env variables from `process.env`, fallback to parsed
|
||||
for (const key of keys) {
|
||||
if (prefixes.some((prefix) => key.startsWith(prefix))) {
|
||||
env[key] = process.env[key] ? process.env[key] : parsed[key];
|
||||
}
|
||||
}
|
||||
|
||||
return env;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a file with proper path resolution
|
||||
* @private
|
||||
* @param {InputFileSystem} fs the input file system
|
||||
* @param {string} file the file to load
|
||||
* @returns {Promise<string>} the content of the file
|
||||
*/
|
||||
_loadFile(fs, file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readFile(file, (err, content) => {
|
||||
if (err) reject(err);
|
||||
else resolve(/** @type {Buffer} */ (content).toString() || "");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DotenvPlugin;
|
||||
0
node_modules/webpack/lib/DynamicEntryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/DynamicEntryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EntryOptionPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EntryOptionPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EntryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EntryPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Entrypoint.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Entrypoint.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EnvironmentNotSupportAsyncWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EnvironmentNotSupportAsyncWarning.js
generated
vendored
Executable file → Normal file
35
node_modules/webpack/lib/EnvironmentPlugin.js
generated
vendored
Executable file → Normal file
35
node_modules/webpack/lib/EnvironmentPlugin.js
generated
vendored
Executable file → Normal file
@@ -39,16 +39,18 @@ class EnvironmentPlugin {
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(compiler) {
|
||||
/** @type {Record<string, CodeValue>} */
|
||||
const definitions = {};
|
||||
for (const key of this.keys) {
|
||||
const value =
|
||||
process.env[key] !== undefined
|
||||
? process.env[key]
|
||||
: this.defaultValues[key];
|
||||
const definePlugin = new DefinePlugin({});
|
||||
|
||||
if (value === undefined) {
|
||||
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
||||
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
||||
/** @type {Record<string, CodeValue>} */
|
||||
const definitions = {};
|
||||
for (const key of this.keys) {
|
||||
const value =
|
||||
process.env[key] !== undefined
|
||||
? process.env[key]
|
||||
: this.defaultValues[key];
|
||||
|
||||
if (value === undefined) {
|
||||
const error = new WebpackError(
|
||||
`${PLUGIN_NAME} - ${key} environment variable is undefined.\n\n` +
|
||||
"You can pass an object with default values to suppress this warning.\n" +
|
||||
@@ -57,14 +59,15 @@ class EnvironmentPlugin {
|
||||
|
||||
error.name = "EnvVariableNotDefinedError";
|
||||
compilation.errors.push(error);
|
||||
});
|
||||
}
|
||||
const defValue =
|
||||
value === undefined ? "undefined" : JSON.stringify(value);
|
||||
definitions[`process.env.${key}`] = defValue;
|
||||
definitions[`import.meta.env.${key}`] = defValue;
|
||||
}
|
||||
|
||||
definitions[`process.env.${key}`] =
|
||||
value === undefined ? "undefined" : JSON.stringify(value);
|
||||
}
|
||||
|
||||
new DefinePlugin(definitions).apply(compiler);
|
||||
definePlugin.definitions = definitions;
|
||||
});
|
||||
definePlugin.apply(compiler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
0
node_modules/webpack/lib/ErrorHelpers.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ErrorHelpers.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EvalDevToolModulePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/EvalDevToolModulePlugin.js
generated
vendored
Executable file → Normal file
16
node_modules/webpack/lib/EvalSourceMapDevToolPlugin.js
generated
vendored
Executable file → Normal file
16
node_modules/webpack/lib/EvalSourceMapDevToolPlugin.js
generated
vendored
Executable file → Normal file
@@ -18,6 +18,7 @@ const { makePathsAbsolute } = require("./util/identifier");
|
||||
/** @typedef {import("webpack-sources").RawSourceMap} RawSourceMap */
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").SourceMapDevToolPluginOptions} SourceMapDevToolPluginOptions */
|
||||
/** @typedef {import("../declarations/plugins/SourceMapDevToolPlugin").Rules} Rules */
|
||||
/** @typedef {import("./ChunkGraph").ModuleId} ModuleId */
|
||||
/** @typedef {import("./Compiler")} Compiler */
|
||||
|
||||
@@ -163,6 +164,21 @@ class EvalSourceMapDevToolPlugin {
|
||||
}
|
||||
);
|
||||
sourceMap.sources = moduleFilenames;
|
||||
sourceMap.ignoreList = options.ignoreList
|
||||
? sourceMap.sources.reduce(
|
||||
/** @type {(acc: number[], sourceName: string, idx: number) => number[]} */ (
|
||||
(acc, sourceName, idx) => {
|
||||
const rule = /** @type {Rules} */ (options.ignoreList);
|
||||
if (ModuleFilenameHelpers.matchPart(sourceName, rule)) {
|
||||
acc.push(idx);
|
||||
}
|
||||
return acc;
|
||||
}
|
||||
),
|
||||
[]
|
||||
)
|
||||
: [];
|
||||
|
||||
if (options.noSources) {
|
||||
sourceMap.sourcesContent = undefined;
|
||||
}
|
||||
|
||||
8
node_modules/webpack/lib/ExportsInfo.js
generated
vendored
Executable file → Normal file
8
node_modules/webpack/lib/ExportsInfo.js
generated
vendored
Executable file → Normal file
@@ -5,6 +5,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { ImportPhaseUtils } = require("./dependencies/ImportPhase");
|
||||
const { equals } = require("./util/ArrayHelpers");
|
||||
const SortableSet = require("./util/SortableSet");
|
||||
const makeSerializable = require("./util/makeSerializable");
|
||||
@@ -1345,8 +1346,11 @@ class ExportInfo {
|
||||
export: rawTarget.export,
|
||||
deferred: Boolean(
|
||||
rawTarget.connection.dependency &&
|
||||
/** @type {HarmonyImportDependency} */
|
||||
(rawTarget.connection.dependency).defer
|
||||
ImportPhaseUtils.isDefer(
|
||||
/** @type {HarmonyImportDependency} */ (
|
||||
rawTarget.connection.dependency
|
||||
).phase
|
||||
)
|
||||
)
|
||||
};
|
||||
for (;;) {
|
||||
|
||||
0
node_modules/webpack/lib/ExportsInfoApiPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ExportsInfoApiPlugin.js
generated
vendored
Executable file → Normal file
48
node_modules/webpack/lib/ExternalModule.js
generated
vendored
Executable file → Normal file
48
node_modules/webpack/lib/ExternalModule.js
generated
vendored
Executable file → Normal file
@@ -28,6 +28,7 @@ const propertyAccess = require("./util/propertyAccess");
|
||||
const { register } = require("./util/serialization");
|
||||
|
||||
/** @typedef {import("webpack-sources").Source} Source */
|
||||
/** @typedef {import("../declarations/WebpackOptions").ExternalsType} ExternalsType */
|
||||
/** @typedef {import("../declarations/WebpackOptions").HashFunction} HashFunction */
|
||||
/** @typedef {import("./config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
|
||||
/** @typedef {import("./Chunk")} Chunk */
|
||||
@@ -442,10 +443,6 @@ const getSourceForModuleExternal = (
|
||||
dependencyMeta,
|
||||
concatenationScope
|
||||
) => {
|
||||
if (!Array.isArray(moduleAndSpecifiers)) {
|
||||
moduleAndSpecifiers = [moduleAndSpecifiers];
|
||||
}
|
||||
|
||||
/** @type {Imported} */
|
||||
let imported = true;
|
||||
if (concatenationScope) {
|
||||
@@ -465,6 +462,15 @@ const getSourceForModuleExternal = (
|
||||
}
|
||||
}
|
||||
|
||||
if (!Array.isArray(moduleAndSpecifiers)) {
|
||||
moduleAndSpecifiers = [moduleAndSpecifiers];
|
||||
}
|
||||
|
||||
// Return to `namespace` when the external request includes a specific export
|
||||
if (moduleAndSpecifiers.length > 1) {
|
||||
imported = true;
|
||||
}
|
||||
|
||||
const initFragment = new ModuleExternalInitFragment(
|
||||
moduleAndSpecifiers[0],
|
||||
imported,
|
||||
@@ -473,22 +479,6 @@ const getSourceForModuleExternal = (
|
||||
runtimeTemplate.outputOptions.hashFunction
|
||||
);
|
||||
const normalizedImported = initFragment.getImported();
|
||||
const specifiers =
|
||||
normalizedImported === true
|
||||
? undefined
|
||||
: /** @type {[string, string][]} */ (
|
||||
normalizedImported.map(([name, rawFinalName]) => {
|
||||
let finalName = rawFinalName;
|
||||
let counter = 0;
|
||||
|
||||
if (concatenationScope) {
|
||||
while (!concatenationScope.registerUsedName(finalName)) {
|
||||
finalName = `${finalName}_${counter++}`;
|
||||
}
|
||||
}
|
||||
return [name, finalName];
|
||||
})
|
||||
);
|
||||
|
||||
const baseAccess = `${initFragment.getNamespaceIdentifier()}${propertyAccess(
|
||||
moduleAndSpecifiers,
|
||||
@@ -518,7 +508,7 @@ const getSourceForModuleExternal = (
|
||||
"x"
|
||||
)}`
|
||||
: undefined,
|
||||
specifiers,
|
||||
specifiers: normalizedImported === true ? undefined : normalizedImported,
|
||||
runtimeRequirements: moduleRemapping
|
||||
? RUNTIME_REQUIREMENTS_FOR_MODULE
|
||||
: undefined,
|
||||
@@ -632,7 +622,7 @@ const getSourceForDefaultCase = (optional, request, runtimeTemplate) => {
|
||||
class ExternalModule extends Module {
|
||||
/**
|
||||
* @param {ExternalModuleRequest} request request
|
||||
* @param {string} type type
|
||||
* @param {ExternalsType} type type
|
||||
* @param {string} userRequest user request
|
||||
* @param {DependencyMeta=} dependencyMeta dependency meta
|
||||
*/
|
||||
@@ -642,7 +632,7 @@ class ExternalModule extends Module {
|
||||
// Info from Factory
|
||||
/** @type {ExternalModuleRequest} */
|
||||
this.request = request;
|
||||
/** @type {string} */
|
||||
/** @type {ExternalsType} */
|
||||
this.externalType = type;
|
||||
/** @type {string} */
|
||||
this.userRequest = userRequest;
|
||||
@@ -821,6 +811,10 @@ class ExternalModule extends Module {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @returns {{ request: string | string[], externalType: ExternalsType }} the request and external type
|
||||
*/
|
||||
_getRequestAndExternalType() {
|
||||
let { request, externalType } = this;
|
||||
if (typeof request === "object" && !Array.isArray(request)) {
|
||||
@@ -833,8 +827,8 @@ class ExternalModule extends Module {
|
||||
/**
|
||||
* Resolve the detailed external type from the raw external type.
|
||||
* e.g. resolve "module" or "import" from "module-import" type
|
||||
* @param {string} externalType raw external type
|
||||
* @returns {string} resolved external type
|
||||
* @param {ExternalsType} externalType raw external type
|
||||
* @returns {ExternalsType} resolved external type
|
||||
*/
|
||||
_resolveExternalType(externalType) {
|
||||
if (externalType === "module-import") {
|
||||
@@ -866,7 +860,7 @@ class ExternalModule extends Module {
|
||||
/**
|
||||
* @private
|
||||
* @param {string | string[]} request request
|
||||
* @param {string} externalType the external type
|
||||
* @param {ExternalsType} externalType the external type
|
||||
* @param {RuntimeTemplate} runtimeTemplate the runtime template
|
||||
* @param {ModuleGraph} moduleGraph the module graph
|
||||
* @param {ChunkGraph} chunkGraph the chunk graph
|
||||
@@ -959,8 +953,6 @@ class ExternalModule extends Module {
|
||||
}
|
||||
case "var":
|
||||
case "promise":
|
||||
case "const":
|
||||
case "let":
|
||||
case "assign":
|
||||
default:
|
||||
return getSourceForDefaultCase(
|
||||
|
||||
18
node_modules/webpack/lib/ExternalModuleFactoryPlugin.js
generated
vendored
Executable file → Normal file
18
node_modules/webpack/lib/ExternalModuleFactoryPlugin.js
generated
vendored
Executable file → Normal file
@@ -16,6 +16,7 @@ const { cachedSetProperty, resolveByProperty } = require("./util/cleverMerge");
|
||||
|
||||
/** @typedef {import("enhanced-resolve").ResolveContext} ResolveContext */
|
||||
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
|
||||
/** @typedef {import("../declarations/WebpackOptions").ExternalsType} ExternalsType */
|
||||
/** @typedef {import("../declarations/WebpackOptions").ExternalItemValue} ExternalItemValue */
|
||||
/** @typedef {import("../declarations/WebpackOptions").ExternalItemObjectKnown} ExternalItemObjectKnown */
|
||||
/** @typedef {import("../declarations/WebpackOptions").ExternalItemObjectUnknown} ExternalItemObjectUnknown */
|
||||
@@ -50,7 +51,7 @@ const callDeprecatedExternals = util.deprecate(
|
||||
* @param {EXPECTED_FUNCTION} externalsFunction externals function
|
||||
* @param {string} context context
|
||||
* @param {string} request request
|
||||
* @param {(err: Error | null | undefined, value: ExternalValue | undefined, ty: ExternalType | undefined) => void} cb cb
|
||||
* @param {(err: Error | null | undefined, value: ExternalValue | undefined, ty: ExternalsType | undefined) => void} cb cb
|
||||
*/
|
||||
(externalsFunction, context, request, cb) => {
|
||||
// eslint-disable-next-line no-useless-call
|
||||
@@ -90,13 +91,12 @@ const resolveLayer = (obj, layer) => {
|
||||
};
|
||||
|
||||
/** @typedef {string | string[] | boolean | Record<string, string | string[]>} ExternalValue */
|
||||
/** @typedef {string | undefined} ExternalType */
|
||||
|
||||
const PLUGIN_NAME = "ExternalModuleFactoryPlugin";
|
||||
|
||||
class ExternalModuleFactoryPlugin {
|
||||
/**
|
||||
* @param {string} type default external type
|
||||
* @param {ExternalsType} type default external type
|
||||
* @param {Externals} externals externals config
|
||||
*/
|
||||
constructor(type, externals) {
|
||||
@@ -122,7 +122,7 @@ class ExternalModuleFactoryPlugin {
|
||||
|
||||
/**
|
||||
* @param {ExternalValue} value the external config
|
||||
* @param {ExternalType | undefined} type type of external
|
||||
* @param {ExternalsType | undefined} type type of external
|
||||
* @param {HandleExternalCallback} callback callback
|
||||
* @returns {void}
|
||||
*/
|
||||
@@ -131,7 +131,7 @@ class ExternalModuleFactoryPlugin {
|
||||
// Not externals, fallback to original factory
|
||||
return callback();
|
||||
}
|
||||
/** @type {string | string[] | Record<string, string|string[]>} */
|
||||
/** @type {ExternalValue} */
|
||||
let externalConfig = value === true ? dependency.request : value;
|
||||
// When no explicit type is specified, extract it from the externalConfig
|
||||
if (type === undefined) {
|
||||
@@ -140,7 +140,9 @@ class ExternalModuleFactoryPlugin {
|
||||
UNSPECIFIED_EXTERNAL_TYPE_REGEXP.test(externalConfig)
|
||||
) {
|
||||
const idx = externalConfig.indexOf(" ");
|
||||
type = externalConfig.slice(0, idx);
|
||||
type =
|
||||
/** @type {ExternalsType} */
|
||||
(externalConfig.slice(0, idx));
|
||||
externalConfig = externalConfig.slice(idx + 1);
|
||||
} else if (
|
||||
Array.isArray(externalConfig) &&
|
||||
@@ -149,7 +151,7 @@ class ExternalModuleFactoryPlugin {
|
||||
) {
|
||||
const firstItem = externalConfig[0];
|
||||
const idx = firstItem.indexOf(" ");
|
||||
type = firstItem.slice(0, idx);
|
||||
type = /** @type {ExternalsType} */ (firstItem.slice(0, idx));
|
||||
externalConfig = [
|
||||
firstItem.slice(idx + 1),
|
||||
...externalConfig.slice(1)
|
||||
@@ -255,7 +257,7 @@ class ExternalModuleFactoryPlugin {
|
||||
/**
|
||||
* @param {Error | null | undefined} err err
|
||||
* @param {ExternalValue=} value value
|
||||
* @param {ExternalType=} type type
|
||||
* @param {ExternalsType=} type type
|
||||
* @returns {void}
|
||||
*/
|
||||
const cb = (err, value, type) => {
|
||||
|
||||
3
node_modules/webpack/lib/ExternalsPlugin.js
generated
vendored
Executable file → Normal file
3
node_modules/webpack/lib/ExternalsPlugin.js
generated
vendored
Executable file → Normal file
@@ -9,6 +9,7 @@ const { ModuleExternalInitFragment } = require("./ExternalModule");
|
||||
const ExternalModuleFactoryPlugin = require("./ExternalModuleFactoryPlugin");
|
||||
const ConcatenatedModule = require("./optimize/ConcatenatedModule");
|
||||
|
||||
/** @typedef {import("../declarations/WebpackOptions").ExternalsType} ExternalsType */
|
||||
/** @typedef {import("../declarations/WebpackOptions").Externals} Externals */
|
||||
/** @typedef {import("./Compiler")} Compiler */
|
||||
/** @typedef {import("./ExternalModule").Imported} Imported */
|
||||
@@ -17,7 +18,7 @@ const PLUGIN_NAME = "ExternalsPlugin";
|
||||
|
||||
class ExternalsPlugin {
|
||||
/**
|
||||
* @param {string} type default external type
|
||||
* @param {ExternalsType} type default external type
|
||||
* @param {Externals} externals externals config
|
||||
*/
|
||||
constructor(type, externals) {
|
||||
|
||||
0
node_modules/webpack/lib/FalseIIFEUmdWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FalseIIFEUmdWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FileSystemInfo.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FileSystemInfo.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagAllModulesAsUsedPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagAllModulesAsUsedPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagDependencyExportsPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagDependencyExportsPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagDependencyUsagePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagDependencyUsagePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagEntryExportAsUsedPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/FlagEntryExportAsUsedPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Generator.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/Generator.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/GraphHelpers.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/GraphHelpers.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HarmonyLinkingError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HarmonyLinkingError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HookWebpackError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HookWebpackError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HotModuleReplacementPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HotModuleReplacementPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HotUpdateChunk.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/HotUpdateChunk.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/IgnoreErrorModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/IgnoreErrorModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/IgnorePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/IgnorePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/IgnoreWarningsPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/IgnoreWarningsPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/InitFragment.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/InitFragment.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/InvalidDependenciesModuleWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/InvalidDependenciesModuleWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/JavascriptMetaInfoPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/JavascriptMetaInfoPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LibManifestPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LibManifestPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LibraryTemplatePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LibraryTemplatePlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LoaderOptionsPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LoaderOptionsPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LoaderTargetPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/LoaderTargetPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/MainTemplate.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/MainTemplate.js
generated
vendored
Executable file → Normal file
235
node_modules/webpack/lib/ManifestPlugin.js
generated
vendored
Normal file
235
node_modules/webpack/lib/ManifestPlugin.js
generated
vendored
Normal file
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Haijie Xie @hai-x
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const { RawSource } = require("webpack-sources");
|
||||
const Compilation = require("./Compilation");
|
||||
const HotUpdateChunk = require("./HotUpdateChunk");
|
||||
const createSchemaValidation = require("./util/create-schema-validation");
|
||||
|
||||
/** @typedef {import("./Compiler")} Compiler */
|
||||
/** @typedef {import("./Chunk")} Chunk */
|
||||
/** @typedef {import("./Chunk").ChunkName} ChunkName */
|
||||
/** @typedef {import("./Chunk").ChunkId} ChunkId */
|
||||
/** @typedef {import("./Compilation").Asset} Asset */
|
||||
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
|
||||
|
||||
/** @typedef {import("../declarations/plugins/ManifestPlugin").ManifestPluginOptions} ManifestPluginOptions */
|
||||
/** @typedef {import("../declarations/plugins/ManifestPlugin").ManifestObject} ManifestObject */
|
||||
/** @typedef {import("../declarations/plugins/ManifestPlugin").ManifestEntrypoint} ManifestEntrypoint */
|
||||
/** @typedef {import("../declarations/plugins/ManifestPlugin").ManifestItem} ManifestItem */
|
||||
|
||||
const PLUGIN_NAME = "ManifestPlugin";
|
||||
|
||||
const validate = createSchemaValidation(
|
||||
require("../schemas/plugins/ManifestPlugin.check"),
|
||||
() => require("../schemas/plugins/ManifestPlugin.json"),
|
||||
{
|
||||
name: "ManifestPlugin",
|
||||
baseDataPath: "options"
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* @param {string} filename filename
|
||||
* @returns {string} extname
|
||||
*/
|
||||
const extname = (filename) => {
|
||||
const replaced = filename.replace(/\?.*/, "");
|
||||
const split = replaced.split(".");
|
||||
const last = split.pop();
|
||||
if (!last) return "";
|
||||
return last && /^(gz|br|map)$/i.test(last) ? `${split.pop()}.${last}` : last;
|
||||
};
|
||||
|
||||
class ManifestPlugin {
|
||||
/**
|
||||
* @param {ManifestPluginOptions} options options
|
||||
*/
|
||||
constructor(options) {
|
||||
validate(options);
|
||||
|
||||
/** @type {ManifestPluginOptions & Required<Omit<ManifestPluginOptions, "filter" | "generate">>} */
|
||||
this.options = {
|
||||
filename: "manifest.json",
|
||||
prefix: "[publicpath]",
|
||||
entrypoints: true,
|
||||
serialize: (manifest) => JSON.stringify(manifest, null, 2),
|
||||
...options
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the plugin
|
||||
* @param {Compiler} compiler the compiler instance
|
||||
* @returns {void}
|
||||
*/
|
||||
apply(compiler) {
|
||||
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
||||
compilation.hooks.processAssets.tap(
|
||||
{
|
||||
name: PLUGIN_NAME,
|
||||
stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
||||
},
|
||||
() => {
|
||||
const hashDigestLength = compilation.outputOptions.hashDigestLength;
|
||||
const publicPath = compilation.getPath(
|
||||
compilation.outputOptions.publicPath
|
||||
);
|
||||
|
||||
/**
|
||||
* @param {string | string[]} value value
|
||||
* @returns {RegExp} regexp to remove hash
|
||||
*/
|
||||
const createHashRegExp = (value) =>
|
||||
new RegExp(
|
||||
`(?:\\.${Array.isArray(value) ? `(${value.join("|")})` : value})(?=\\.)`,
|
||||
"gi"
|
||||
);
|
||||
|
||||
/**
|
||||
* @param {string} name name
|
||||
* @param {AssetInfo | null} info asset info
|
||||
* @returns {string} hash removed name
|
||||
*/
|
||||
const removeHash = (name, info) => {
|
||||
// Handles hashes that match configured `hashDigestLength`
|
||||
// i.e. index.XXXX.html -> index.html (html-webpack-plugin)
|
||||
if (hashDigestLength <= 0) return name;
|
||||
const reg = createHashRegExp(`[a-f0-9]{${hashDigestLength},32}`);
|
||||
return name.replace(reg, "");
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Chunk} chunk chunk
|
||||
* @returns {ChunkName | ChunkId} chunk name or chunk id
|
||||
*/
|
||||
const getName = (chunk) => {
|
||||
if (chunk.name) return chunk.name;
|
||||
|
||||
return chunk.id;
|
||||
};
|
||||
|
||||
/** @type {ManifestObject} */
|
||||
let manifest = {};
|
||||
|
||||
if (this.options.entrypoints) {
|
||||
/** @type {ManifestObject["entrypoints"]} */
|
||||
const entrypoints = {};
|
||||
|
||||
for (const [name, entrypoint] of compilation.entrypoints) {
|
||||
const imports = [];
|
||||
|
||||
for (const chunk of entrypoint.chunks) {
|
||||
for (const file of chunk.files) {
|
||||
const name = getName(chunk);
|
||||
|
||||
imports.push(name ? `${name}.${extname(file)}` : file);
|
||||
}
|
||||
}
|
||||
|
||||
/** @type {ManifestEntrypoint} */
|
||||
const item = { imports };
|
||||
const parents = entrypoint
|
||||
.getParents()
|
||||
.map((item) => /** @type {string} */ (item.name));
|
||||
|
||||
if (parents.length > 0) {
|
||||
item.parents = parents;
|
||||
}
|
||||
|
||||
entrypoints[name] = item;
|
||||
}
|
||||
|
||||
manifest.entrypoints = entrypoints;
|
||||
}
|
||||
|
||||
/** @type {ManifestObject["assets"]} */
|
||||
const assets = {};
|
||||
|
||||
/** @type {Set<string>} */
|
||||
const added = new Set();
|
||||
|
||||
/**
|
||||
* @param {string} file file
|
||||
* @param {string=} usedName usedName
|
||||
* @returns {void}
|
||||
*/
|
||||
const handleFile = (file, usedName) => {
|
||||
if (added.has(file)) return;
|
||||
added.add(file);
|
||||
|
||||
const asset = compilation.getAsset(file);
|
||||
if (!asset) return;
|
||||
const sourceFilename = asset.info.sourceFilename;
|
||||
const name =
|
||||
usedName ||
|
||||
sourceFilename ||
|
||||
// Fallback for unofficial plugins, just remove hash from filename
|
||||
removeHash(file, asset.info);
|
||||
|
||||
const prefix = this.options.prefix.replace(
|
||||
/\[publicpath\]/gi,
|
||||
() => (publicPath === "auto" ? "/" : publicPath)
|
||||
);
|
||||
/** @type {ManifestItem} */
|
||||
const item = { file: prefix + file };
|
||||
|
||||
if (sourceFilename) {
|
||||
item.src = sourceFilename;
|
||||
}
|
||||
|
||||
if (this.options.filter) {
|
||||
const needKeep = this.options.filter(item);
|
||||
|
||||
if (!needKeep) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
assets[name] = item;
|
||||
};
|
||||
|
||||
for (const chunk of compilation.chunks) {
|
||||
if (chunk instanceof HotUpdateChunk) continue;
|
||||
|
||||
for (const auxiliaryFile of chunk.auxiliaryFiles) {
|
||||
handleFile(auxiliaryFile);
|
||||
}
|
||||
|
||||
const name = getName(chunk);
|
||||
|
||||
for (const file of chunk.files) {
|
||||
handleFile(file, name ? `${name}.${extname(file)}` : file);
|
||||
}
|
||||
}
|
||||
|
||||
for (const asset of compilation.getAssets()) {
|
||||
if (asset.info.hotModuleReplacement) {
|
||||
continue;
|
||||
}
|
||||
|
||||
handleFile(asset.name);
|
||||
}
|
||||
|
||||
manifest.assets = assets;
|
||||
|
||||
if (this.options.generate) {
|
||||
manifest = this.options.generate(manifest);
|
||||
}
|
||||
|
||||
compilation.emitAsset(
|
||||
this.options.filename,
|
||||
new RawSource(this.options.serialize(manifest)),
|
||||
{ manifest: true }
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ManifestPlugin;
|
||||
3
node_modules/webpack/lib/Module.js
generated
vendored
Executable file → Normal file
3
node_modules/webpack/lib/Module.js
generated
vendored
Executable file → Normal file
@@ -39,6 +39,8 @@ const makeSerializable = require("./util/makeSerializable");
|
||||
/** @typedef {import("./RequestShortener")} RequestShortener */
|
||||
/** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */
|
||||
/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */
|
||||
/** @typedef {import("../declarations/WebpackOptions").CssParserExportType} CssParserExportType */
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import("./InitFragment")<T>} InitFragment
|
||||
@@ -116,6 +118,7 @@ const makeSerializable = require("./util/makeSerializable");
|
||||
/**
|
||||
* @typedef {object} KnownBuildMeta
|
||||
* @property {("default" | "namespace" | "flagged" | "dynamic")=} exportsType
|
||||
* @property {CssParserExportType=} exportType
|
||||
* @property {(false | "redirect" | "redirect-warn")=} defaultObject
|
||||
* @property {boolean=} strictHarmonyModule
|
||||
* @property {boolean=} treatAsCommonJs
|
||||
|
||||
0
node_modules/webpack/lib/ModuleBuildError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleBuildError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleDependencyError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleDependencyError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleDependencyWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleDependencyWarning.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleFactory.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleFilenameHelpers.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleFilenameHelpers.js
generated
vendored
Executable file → Normal file
3
node_modules/webpack/lib/ModuleGraph.js
generated
vendored
Executable file → Normal file
3
node_modules/webpack/lib/ModuleGraph.js
generated
vendored
Executable file → Normal file
@@ -9,6 +9,7 @@ const util = require("util");
|
||||
const ExportsInfo = require("./ExportsInfo");
|
||||
const ModuleGraphConnection = require("./ModuleGraphConnection");
|
||||
const HarmonyImportDependency = require("./dependencies/HarmonyImportDependency");
|
||||
const { ImportPhaseUtils } = require("./dependencies/ImportPhase");
|
||||
const SortableSet = require("./util/SortableSet");
|
||||
const WeakTupleMap = require("./util/WeakTupleMap");
|
||||
const { sortWithSourceOrder } = require("./util/comparators");
|
||||
@@ -844,7 +845,7 @@ class ModuleGraph {
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (connection.dependency.defer) return true;
|
||||
if (ImportPhaseUtils.isDefer(connection.dependency.phase)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
0
node_modules/webpack/lib/ModuleGraphConnection.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleGraphConnection.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleHashingError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleHashingError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleInfoHeaderPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleInfoHeaderPlugin.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleNotFoundError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleNotFoundError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleParseError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleParseError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleProfile.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleProfile.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleRestoreError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleRestoreError.js
generated
vendored
Executable file → Normal file
6
node_modules/webpack/lib/ModuleSourceTypesConstants.js
generated
vendored
Executable file → Normal file
6
node_modules/webpack/lib/ModuleSourceTypesConstants.js
generated
vendored
Executable file → Normal file
@@ -44,11 +44,6 @@ const JS_TYPE = "javascript";
|
||||
*/
|
||||
const JS_TYPES = new Set(["javascript"]);
|
||||
|
||||
/**
|
||||
* @type {ReadonlySet<"javascript" | "css-export">}
|
||||
*/
|
||||
const JS_AND_CSS_EXPORT_TYPES = new Set(["javascript", "css-export"]);
|
||||
|
||||
/**
|
||||
* @type {ReadonlySet<"javascript" | "css-url">}
|
||||
*/
|
||||
@@ -111,7 +106,6 @@ module.exports.CSS_IMPORT_TYPES = CSS_IMPORT_TYPES;
|
||||
module.exports.CSS_TYPE = CSS_TYPE;
|
||||
module.exports.CSS_TYPES = CSS_TYPES;
|
||||
module.exports.CSS_URL_TYPES = CSS_URL_TYPES;
|
||||
module.exports.JS_AND_CSS_EXPORT_TYPES = JS_AND_CSS_EXPORT_TYPES;
|
||||
module.exports.JS_AND_CSS_TYPES = JS_AND_CSS_TYPES;
|
||||
module.exports.JS_AND_CSS_URL_TYPES = JS_AND_CSS_URL_TYPES;
|
||||
module.exports.JS_TYPE = JS_TYPE;
|
||||
|
||||
0
node_modules/webpack/lib/ModuleStoreError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleStoreError.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleTemplate.js
generated
vendored
Executable file → Normal file
0
node_modules/webpack/lib/ModuleTemplate.js
generated
vendored
Executable file → Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user