@umijs/mfsu 4.0.0-canary.20220720.1 → 4.0.0-canary.20220727.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/moduleGraph.js +17 -7
- package/package.json +6 -6
package/dist/moduleGraph.js
CHANGED
|
@@ -58,12 +58,18 @@ var ModuleGraph = class {
|
|
|
58
58
|
this.rootModules = /* @__PURE__ */ new Set();
|
|
59
59
|
}
|
|
60
60
|
restore(data) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
const getModuleNode = (file) => {
|
|
62
|
+
if (this.fileToModules.has(file)) {
|
|
63
|
+
return this.fileToModules.get(file);
|
|
64
|
+
}
|
|
65
|
+
if (this.depToModules.has(file)) {
|
|
66
|
+
return this.depToModules.get(file);
|
|
67
|
+
}
|
|
66
68
|
const mod = new ModuleNode(file);
|
|
69
|
+
return mod;
|
|
70
|
+
};
|
|
71
|
+
const addNode = ({ file, importer }) => {
|
|
72
|
+
const mod = getModuleNode(file);
|
|
67
73
|
let isDependency = false;
|
|
68
74
|
let info;
|
|
69
75
|
if (data.fileModules[file]) {
|
|
@@ -76,7 +82,11 @@ var ModuleGraph = class {
|
|
|
76
82
|
mod.isRoot = true;
|
|
77
83
|
if (importer) {
|
|
78
84
|
mod.importers.add(importer);
|
|
79
|
-
importer.importedModules.
|
|
85
|
+
if (!importer.importedModules.has(mod)) {
|
|
86
|
+
importer.importedModules.add(mod);
|
|
87
|
+
} else {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
80
90
|
}
|
|
81
91
|
mod.isDependency = isDependency;
|
|
82
92
|
if (info.version !== void 0) {
|
|
@@ -85,10 +95,10 @@ var ModuleGraph = class {
|
|
|
85
95
|
if (isDependency) {
|
|
86
96
|
this.depToModules.set(file, mod);
|
|
87
97
|
} else {
|
|
98
|
+
this.fileToModules.set(file, mod);
|
|
88
99
|
for (const importedModule of info.importedModules) {
|
|
89
100
|
addNode({ file: importedModule, importer: mod });
|
|
90
101
|
}
|
|
91
|
-
this.fileToModules.set(file, mod);
|
|
92
102
|
}
|
|
93
103
|
};
|
|
94
104
|
for (const root of data.roots) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/mfsu",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20220727.1",
|
|
4
4
|
"description": "@umijs/mfsu",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/mfsu#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"vendors"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "
|
|
20
|
+
"build": "umi-scripts father build",
|
|
21
21
|
"build:deps": "umi-scripts bundleDeps",
|
|
22
|
-
"dev": "
|
|
22
|
+
"dev": "umi-scripts father dev",
|
|
23
23
|
"test": "umi-scripts jest-turbo"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@umijs/bundler-esbuild": "4.0.0-canary.
|
|
27
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
28
|
-
"@umijs/utils": "4.0.0-canary.
|
|
26
|
+
"@umijs/bundler-esbuild": "4.0.0-canary.20220727.1",
|
|
27
|
+
"@umijs/bundler-utils": "4.0.0-canary.20220727.1",
|
|
28
|
+
"@umijs/utils": "4.0.0-canary.20220727.1",
|
|
29
29
|
"enhanced-resolve": "5.9.3",
|
|
30
30
|
"is-equal": "^1.6.4"
|
|
31
31
|
},
|