feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -50,7 +50,7 @@ class CommonJsSelfReferenceDependency extends NullDependency {
* @returns {string | null} an identifier to merge equal requests
*/
getResourceIdentifier() {
return `self`;
return "self";
}
/**
@@ -108,19 +108,17 @@ CommonJsSelfReferenceDependency.Template = class CommonJsSelfReferenceDependency
{ module, moduleGraph, runtime, runtimeRequirements }
) {
const dep = /** @type {CommonJsSelfReferenceDependency} */ (dependency);
let used;
if (dep.names.length === 0) {
used = dep.names;
} else {
used = moduleGraph.getExportsInfo(module).getUsedName(dep.names, runtime);
}
const used =
dep.names.length === 0
? dep.names
: moduleGraph.getExportsInfo(module).getUsedName(dep.names, runtime);
if (!used) {
throw new Error(
"Self-reference dependency has unused export name: This should not happen"
);
}
let base = undefined;
let base;
switch (dep.base) {
case "exports":
runtimeRequirements.add(RuntimeGlobals.exports);