Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
100
node_modules/webpack/lib/APIPlugin.js
generated
vendored
100
node_modules/webpack/lib/APIPlugin.js
generated
vendored
@@ -16,6 +16,8 @@ const {
|
||||
const RuntimeGlobals = require("./RuntimeGlobals");
|
||||
const WebpackError = require("./WebpackError");
|
||||
const ConstDependency = require("./dependencies/ConstDependency");
|
||||
const ModuleInitFragmentDependency = require("./dependencies/ModuleInitFragmentDependency");
|
||||
const RuntimeRequirementsDependency = require("./dependencies/RuntimeRequirementsDependency");
|
||||
const BasicEvaluatedExpression = require("./javascript/BasicEvaluatedExpression");
|
||||
const JavascriptModulesPlugin = require("./javascript/JavascriptModulesPlugin");
|
||||
const {
|
||||
@@ -32,7 +34,7 @@ const GetFullHashRuntimeModule = require("./runtime/GetFullHashRuntimeModule");
|
||||
/** @typedef {import("./javascript/JavascriptParser").Range} Range */
|
||||
|
||||
/**
|
||||
* @returns {Record<string, {expr: string, req: string[] | null, type?: string, assign: boolean}>} replacements
|
||||
* @returns {Record<string, { expr: string, req: string[] | null, type?: string, assign: boolean }>} replacements
|
||||
*/
|
||||
function getReplacements() {
|
||||
return {
|
||||
@@ -160,6 +162,10 @@ class APIPlugin {
|
||||
ConstDependency,
|
||||
new ConstDependency.Template()
|
||||
);
|
||||
compilation.dependencyTemplates.set(
|
||||
ModuleInitFragmentDependency,
|
||||
new ModuleInitFragmentDependency.Template()
|
||||
);
|
||||
|
||||
compilation.hooks.runtimeRequirementInTree
|
||||
.for(RuntimeGlobals.chunkName)
|
||||
@@ -201,6 +207,40 @@ class APIPlugin {
|
||||
* @param {JavascriptParser} parser the parser
|
||||
*/
|
||||
const handler = (parser) => {
|
||||
parser.hooks.preDeclarator.tap(PLUGIN_NAME, (declarator) => {
|
||||
if (
|
||||
parser.scope.topLevelScope === true &&
|
||||
declarator.id.type === "Identifier" &&
|
||||
declarator.id.name === "module"
|
||||
) {
|
||||
/** @type {BuildInfo} */
|
||||
(parser.state.module.buildInfo).moduleArgument =
|
||||
"__webpack_module__";
|
||||
}
|
||||
});
|
||||
|
||||
parser.hooks.preStatement.tap(PLUGIN_NAME, (statement) => {
|
||||
if (parser.scope.topLevelScope === true) {
|
||||
if (
|
||||
statement.type === "FunctionDeclaration" &&
|
||||
statement.id &&
|
||||
statement.id.name === "module"
|
||||
) {
|
||||
/** @type {BuildInfo} */
|
||||
(parser.state.module.buildInfo).moduleArgument =
|
||||
"__webpack_module__";
|
||||
} else if (
|
||||
statement.type === "ClassDeclaration" &&
|
||||
statement.id &&
|
||||
statement.id.name === "module"
|
||||
) {
|
||||
/** @type {BuildInfo} */
|
||||
(parser.state.module.buildInfo).moduleArgument =
|
||||
"__webpack_module__";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (const key of Object.keys(REPLACEMENTS)) {
|
||||
const info = REPLACEMENTS[key];
|
||||
parser.hooks.expression.for(key).tap(PLUGIN_NAME, (expression) => {
|
||||
@@ -275,13 +315,28 @@ class APIPlugin {
|
||||
/** @type {BuildInfo} */
|
||||
(parser.state.module.buildInfo).moduleConcatenationBailout =
|
||||
"__webpack_module__.id";
|
||||
const dep = new ConstDependency(
|
||||
`${parser.state.module.moduleArgument}.id`,
|
||||
/** @type {Range} */ (expr.range),
|
||||
[RuntimeGlobals.moduleId]
|
||||
);
|
||||
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
||||
parser.state.module.addPresentationalDependency(dep);
|
||||
const moduleArgument = parser.state.module.moduleArgument;
|
||||
if (moduleArgument === "__webpack_module__") {
|
||||
const dep = new RuntimeRequirementsDependency([
|
||||
RuntimeGlobals.moduleId
|
||||
]);
|
||||
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
||||
parser.state.module.addPresentationalDependency(dep);
|
||||
} else {
|
||||
const initDep = new ModuleInitFragmentDependency(
|
||||
`var __webpack_internal_module_id__ = ${moduleArgument}.id;\n`,
|
||||
[RuntimeGlobals.moduleId],
|
||||
"__webpack_internal_module_id__"
|
||||
);
|
||||
parser.state.module.addPresentationalDependency(initDep);
|
||||
const dep = new ConstDependency(
|
||||
"__webpack_internal_module_id__",
|
||||
/** @type {Range} */ (expr.range),
|
||||
[]
|
||||
);
|
||||
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
||||
parser.state.module.addPresentationalDependency(dep);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
@@ -291,13 +346,28 @@ class APIPlugin {
|
||||
/** @type {BuildInfo} */
|
||||
(parser.state.module.buildInfo).moduleConcatenationBailout =
|
||||
"__webpack_module__";
|
||||
const dep = new ConstDependency(
|
||||
parser.state.module.moduleArgument,
|
||||
/** @type {Range} */ (expr.range),
|
||||
[RuntimeGlobals.module]
|
||||
);
|
||||
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
||||
parser.state.module.addPresentationalDependency(dep);
|
||||
const moduleArgument = parser.state.module.moduleArgument;
|
||||
if (moduleArgument === "__webpack_module__") {
|
||||
const dep = new RuntimeRequirementsDependency([
|
||||
RuntimeGlobals.module
|
||||
]);
|
||||
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
||||
parser.state.module.addPresentationalDependency(dep);
|
||||
} else {
|
||||
const initDep = new ModuleInitFragmentDependency(
|
||||
`var __webpack_internal_module__ = ${moduleArgument};\n`,
|
||||
[RuntimeGlobals.module],
|
||||
"__webpack_internal_module__"
|
||||
);
|
||||
parser.state.module.addPresentationalDependency(initDep);
|
||||
const dep = new ConstDependency(
|
||||
"__webpack_internal_module__",
|
||||
/** @type {Range} */ (expr.range),
|
||||
[]
|
||||
);
|
||||
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
||||
parser.state.module.addPresentationalDependency(dep);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
parser.hooks.evaluateTypeof
|
||||
|
||||
Reference in New Issue
Block a user