@umijs/preset-umi 4.4.13-canary.20250912.1 → 4.4.13-canary.20250915.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.
@@ -110,7 +110,7 @@ var tmpFiles_default = (api) => {
110
110
  [`${api.appData.umi.importSource}/typings`]: [
111
111
  `${umiTempDir}/typings`
112
112
  ],
113
- ...api.config.vite || api.config.utoopack ? {
113
+ ...api.config.vite ? {
114
114
  "@fs/*": ["*"]
115
115
  } : {}
116
116
  }
@@ -33,9 +33,14 @@ __export(utoopack_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(utoopack_exports);
35
35
  var import_bundler_utoopack = require("@umijs/bundler-utoopack");
36
+ var import_utils = require("@umijs/utils");
36
37
  var import_path = require("path");
37
38
  var import_extractEntryAssets = require("../../utils/extractEntryAssets");
38
39
  var utoopack_default = (api) => {
40
+ const nodeVersion = process.env.NODE_VERSION ? parseInt(process.env.NODE_VERSION) : parseInt(process.version.slice(1).split(".")[0]);
41
+ if (nodeVersion < 20 && process.env.UTOOPACK_FORCE !== "true") {
42
+ return;
43
+ }
39
44
  api.describe({
40
45
  key: "utoopack",
41
46
  config: {
@@ -45,6 +50,9 @@ var utoopack_default = (api) => {
45
50
  },
46
51
  enableBy: api.EnableBy.config
47
52
  });
53
+ api.onCheck(() => {
54
+ (0, import_utils.checkVersion)(20, `Node 20 is required when using utoopack.`);
55
+ });
48
56
  const assets = {
49
57
  // Will contain all js and mjs files
50
58
  js: [],
@@ -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, isUtoopack?: boolean): string;
22
+ }, api: IApi): string;
@@ -24,7 +24,6 @@ __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");
28
27
  var import_utils = require("@umijs/utils");
29
28
  var import_path = require("path");
30
29
  var IEAR_REG_EXP = new RegExp(
@@ -90,11 +89,7 @@ var IEAR_REG_EXP = new RegExp(
90
89
  // match full-content
91
90
  "g"
92
91
  );
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
- }
92
+ function transformIEAR({ content, path }, api) {
98
93
  return content.replace(IEAR_REG_EXP, (_, prefix, quote, absPath) => {
99
94
  if (absPath.startsWith(api.paths.absTmpPath)) {
100
95
  absPath = (0, import_utils.winPath)((0, import_path.relative)((0, import_path.dirname)(path), absPath)).replace(
@@ -104,12 +99,6 @@ function transformIEAR({ content, path }, api, isUtoopack = false) {
104
99
  );
105
100
  } else if ((0, import_bundler_utils.isDepPath)(absPath)) {
106
101
  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
- );
113
102
  }
114
103
  return `${prefix}${quote}${absPath}${quote}`;
115
104
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.4.13-canary.20250912.1",
3
+ "version": "4.4.13-canary.20250915.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/ast": "4.4.13-canary.20250912.1",
47
- "@umijs/bundler-esbuild": "4.4.13-canary.20250912.1",
48
- "@umijs/babel-preset-umi": "4.4.13-canary.20250912.1",
49
- "@umijs/bundler-utils": "4.4.13-canary.20250912.1",
50
- "@umijs/mfsu": "4.4.13-canary.20250912.1",
51
- "@umijs/bundler-utoopack": "4.4.13-canary.20250912.1",
52
- "@umijs/bundler-webpack": "4.4.13-canary.20250912.1",
53
- "@umijs/core": "4.4.13-canary.20250912.1",
54
- "@umijs/renderer-react": "4.4.13-canary.20250912.1",
55
- "@umijs/server": "4.4.13-canary.20250912.1",
56
- "@umijs/plugin-run": "4.4.13-canary.20250912.1",
57
- "@umijs/utils": "4.4.13-canary.20250912.1",
58
- "@umijs/zod2ts": "4.4.13-canary.20250912.1",
59
- "@umijs/bundler-vite": "4.4.13-canary.20250912.1",
46
+ "@umijs/ast": "4.4.13-canary.20250915.1",
47
+ "@umijs/bundler-esbuild": "4.4.13-canary.20250915.1",
48
+ "@umijs/babel-preset-umi": "4.4.13-canary.20250915.1",
49
+ "@umijs/bundler-utils": "4.4.13-canary.20250915.1",
50
+ "@umijs/bundler-vite": "4.4.13-canary.20250915.1",
51
+ "@umijs/bundler-utoopack": "4.4.13-canary.20250915.1",
52
+ "@umijs/bundler-webpack": "4.4.13-canary.20250915.1",
53
+ "@umijs/core": "4.4.13-canary.20250915.1",
54
+ "@umijs/mfsu": "4.4.13-canary.20250915.1",
55
+ "@umijs/plugin-run": "4.4.13-canary.20250915.1",
56
+ "@umijs/server": "4.4.13-canary.20250915.1",
57
+ "@umijs/renderer-react": "4.4.13-canary.20250915.1",
58
+ "@umijs/utils": "4.4.13-canary.20250915.1",
59
+ "@umijs/zod2ts": "4.4.13-canary.20250915.1",
60
60
  "@umijs/ui": "3.0.1"
61
61
  },
62
62
  "devDependencies": {