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

@@ -54,14 +54,15 @@ class FlagDependencyExportsPlugin {
const exportsInfo = moduleGraph.getExportsInfo(module);
// If the module doesn't have an exportsType, it's a module
// without declared exports.
if (!module.buildMeta || !module.buildMeta.exportsType) {
if (exportsInfo.otherExportsInfo.provided !== null) {
// It's a module without declared exports
statNoExports++;
exportsInfo.setHasProvideInfo();
exportsInfo.setUnknownExportsProvided();
return callback();
}
if (
(!module.buildMeta || !module.buildMeta.exportsType) &&
exportsInfo.otherExportsInfo.provided !== null
) {
// It's a module without declared exports
statNoExports++;
exportsInfo.setHasProvideInfo();
exportsInfo.setUnknownExportsProvided();
return callback();
}
// If the module has no hash, it's uncacheable
if (
@@ -189,9 +190,9 @@ class FlagDependencyExportsPlugin {
let name;
let canMangle = globalCanMangle;
let terminalBinding = globalTerminalBinding;
let exports = undefined;
let exports;
let from = globalFrom;
let fromExport = undefined;
let fromExport;
let priority = globalPriority;
let hidden = false;
if (typeof exportNameOrSpec === "string") {
@@ -261,7 +262,7 @@ class FlagDependencyExportsPlugin {
// Recalculate target exportsInfo
const target = exportInfo.getTarget(moduleGraph);
let targetExportsInfo = undefined;
let targetExportsInfo;
if (target) {
const targetModuleExportsInfo =
moduleGraph.getExportsInfo(target.module);