@umijs/preset-umi 4.4.13-canary.20250910.1 → 4.4.13-canary.20250911.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/registerMethods.js
CHANGED
|
@@ -136,9 +136,10 @@ var registerMethods_default = (api) => {
|
|
|
136
136
|
content.trim(),
|
|
137
137
|
""
|
|
138
138
|
].filter((text) => text !== false).join("\n");
|
|
139
|
-
|
|
139
|
+
const isUtoopack = api.appData.bundler === "utoopack";
|
|
140
|
+
if ((api.appData.vite || isUtoopack) && isJsFile) {
|
|
140
141
|
const transformIEAR = transformModule.default;
|
|
141
|
-
content = transformIEAR({ content, path: absPath }, api);
|
|
142
|
+
content = transformIEAR({ content, path: absPath }, api, isUtoopack);
|
|
142
143
|
}
|
|
143
144
|
if (!(0, import_fs.existsSync)(absPath)) {
|
|
144
145
|
(0, import_fs.writeFileSync)(absPath, content, "utf-8");
|
|
@@ -24,6 +24,7 @@ __export(transformIEAR_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(transformIEAR_exports);
|
|
26
26
|
var import_bundler_utils = require("@umijs/bundler-utils");
|
|
27
|
+
var import_bundler_utoopack = require("@umijs/bundler-utoopack");
|
|
27
28
|
var import_utils = require("@umijs/utils");
|
|
28
29
|
var import_path = require("path");
|
|
29
30
|
var IEAR_REG_EXP = new RegExp(
|
|
@@ -89,7 +90,11 @@ var IEAR_REG_EXP = new RegExp(
|
|
|
89
90
|
// match full-content
|
|
90
91
|
"g"
|
|
91
92
|
);
|
|
92
|
-
function transformIEAR({ content, path }, api) {
|
|
93
|
+
function transformIEAR({ content, path }, api, isUtoopack = false) {
|
|
94
|
+
let rootPath = api.cwd;
|
|
95
|
+
if (isUtoopack) {
|
|
96
|
+
rootPath = (0, import_bundler_utoopack.findRootDir)(api.cwd);
|
|
97
|
+
}
|
|
93
98
|
return content.replace(IEAR_REG_EXP, (_, prefix, quote, absPath) => {
|
|
94
99
|
if (absPath.startsWith(api.paths.absTmpPath)) {
|
|
95
100
|
absPath = (0, import_utils.winPath)((0, import_path.relative)((0, import_path.dirname)(path), absPath)).replace(
|
|
@@ -99,6 +104,12 @@ function transformIEAR({ content, path }, api) {
|
|
|
99
104
|
);
|
|
100
105
|
} else if ((0, import_bundler_utils.isDepPath)(absPath)) {
|
|
101
106
|
absPath = `@fs/${(0, import_utils.winPath)((0, import_path.relative)(api.cwd, absPath))}`;
|
|
107
|
+
} else if (absPath.startsWith(rootPath) && isUtoopack) {
|
|
108
|
+
absPath = (0, import_utils.winPath)((0, import_path.relative)((0, import_path.dirname)(path), absPath)).replace(
|
|
109
|
+
// prepend ./ for same or sub level imports
|
|
110
|
+
/^(?!\.\.\/)/,
|
|
111
|
+
"./"
|
|
112
|
+
);
|
|
102
113
|
}
|
|
103
114
|
return `${prefix}${quote}${absPath}${quote}`;
|
|
104
115
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.4.13-canary.
|
|
3
|
+
"version": "4.4.13-canary.20250911.1",
|
|
4
4
|
"description": "@umijs/preset-umi",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/preset-umi#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -43,20 +43,20 @@
|
|
|
43
43
|
"react-router": "6.3.0",
|
|
44
44
|
"react-router-dom": "6.3.0",
|
|
45
45
|
"regenerator-runtime": "0.13.11",
|
|
46
|
-
"@umijs/
|
|
47
|
-
"@umijs/
|
|
48
|
-
"@umijs/
|
|
49
|
-
"@umijs/bundler-
|
|
50
|
-
"@umijs/bundler-
|
|
51
|
-
"@umijs/core": "4.4.13-canary.
|
|
52
|
-
"@umijs/
|
|
53
|
-
"@umijs/
|
|
54
|
-
"@umijs/
|
|
55
|
-
"@umijs/
|
|
56
|
-
"@umijs/server": "4.4.13-canary.
|
|
57
|
-
"@umijs/
|
|
58
|
-
"@umijs/
|
|
59
|
-
"@umijs/
|
|
46
|
+
"@umijs/ast": "4.4.13-canary.20250911.1",
|
|
47
|
+
"@umijs/bundler-utils": "4.4.13-canary.20250911.1",
|
|
48
|
+
"@umijs/bundler-utoopack": "4.4.13-canary.20250911.1",
|
|
49
|
+
"@umijs/bundler-vite": "4.4.13-canary.20250911.1",
|
|
50
|
+
"@umijs/bundler-webpack": "4.4.13-canary.20250911.1",
|
|
51
|
+
"@umijs/core": "4.4.13-canary.20250911.1",
|
|
52
|
+
"@umijs/mfsu": "4.4.13-canary.20250911.1",
|
|
53
|
+
"@umijs/babel-preset-umi": "4.4.13-canary.20250911.1",
|
|
54
|
+
"@umijs/plugin-run": "4.4.13-canary.20250911.1",
|
|
55
|
+
"@umijs/renderer-react": "4.4.13-canary.20250911.1",
|
|
56
|
+
"@umijs/server": "4.4.13-canary.20250911.1",
|
|
57
|
+
"@umijs/utils": "4.4.13-canary.20250911.1",
|
|
58
|
+
"@umijs/zod2ts": "4.4.13-canary.20250911.1",
|
|
59
|
+
"@umijs/bundler-esbuild": "4.4.13-canary.20250911.1",
|
|
60
60
|
"@umijs/ui": "3.0.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|