@umijs/preset-umi 4.4.13-canary.20250910.1 → 4.4.13-canary.20250911.3

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.
@@ -19,4 +19,4 @@ export declare const IEAR_REG_EXP: RegExp;
19
19
  export default function transformIEAR({ content, path }: {
20
20
  content: string;
21
21
  path: string;
22
- }, api: IApi): string;
22
+ }, api: IApi, isUtoopack?: boolean): string;
@@ -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.20250910.1",
3
+ "version": "4.4.13-canary.20250911.3",
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/bundler-utils": "4.4.13-canary.20250910.1",
47
- "@umijs/babel-preset-umi": "4.4.13-canary.20250910.1",
48
- "@umijs/ast": "4.4.13-canary.20250910.1",
49
- "@umijs/bundler-esbuild": "4.4.13-canary.20250910.1",
50
- "@umijs/bundler-utoopack": "4.4.13-canary.20250910.1",
51
- "@umijs/core": "4.4.13-canary.20250910.1",
52
- "@umijs/bundler-webpack": "4.4.13-canary.20250910.1",
53
- "@umijs/bundler-vite": "4.4.13-canary.20250910.1",
54
- "@umijs/mfsu": "4.4.13-canary.20250910.1",
55
- "@umijs/plugin-run": "4.4.13-canary.20250910.1",
56
- "@umijs/server": "4.4.13-canary.20250910.1",
57
- "@umijs/renderer-react": "4.4.13-canary.20250910.1",
58
- "@umijs/utils": "4.4.13-canary.20250910.1",
59
- "@umijs/zod2ts": "4.4.13-canary.20250910.1",
46
+ "@umijs/ast": "4.4.13-canary.20250911.3",
47
+ "@umijs/bundler-utoopack": "4.4.13-canary.20250911.3",
48
+ "@umijs/babel-preset-umi": "4.4.13-canary.20250911.3",
49
+ "@umijs/bundler-vite": "4.4.13-canary.20250911.3",
50
+ "@umijs/mfsu": "4.4.13-canary.20250911.3",
51
+ "@umijs/bundler-utils": "4.4.13-canary.20250911.3",
52
+ "@umijs/bundler-webpack": "4.4.13-canary.20250911.3",
53
+ "@umijs/plugin-run": "4.4.13-canary.20250911.3",
54
+ "@umijs/bundler-esbuild": "4.4.13-canary.20250911.3",
55
+ "@umijs/server": "4.4.13-canary.20250911.3",
56
+ "@umijs/core": "4.4.13-canary.20250911.3",
57
+ "@umijs/renderer-react": "4.4.13-canary.20250911.3",
58
+ "@umijs/zod2ts": "4.4.13-canary.20250911.3",
59
+ "@umijs/utils": "4.4.13-canary.20250911.3",
60
60
  "@umijs/ui": "3.0.1"
61
61
  },
62
62
  "devDependencies": {