@umijs/preset-umi 4.4.13-canary.20250915.2 → 4.4.13-canary.20250915.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.
@@ -32,15 +32,10 @@ __export(utoopack_exports, {
32
32
  default: () => utoopack_default
33
33
  });
34
34
  module.exports = __toCommonJS(utoopack_exports);
35
- var import_bundler_utoopack = require("@umijs/bundler-utoopack");
36
35
  var import_utils = require("@umijs/utils");
37
36
  var import_path = require("path");
38
37
  var import_extractEntryAssets = require("../../utils/extractEntryAssets");
39
38
  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
- }
44
39
  api.describe({
45
40
  key: "utoopack",
46
41
  config: {
@@ -48,7 +43,7 @@ var utoopack_default = (api) => {
48
43
  return zod.object({}).partial();
49
44
  }
50
45
  },
51
- enableBy: api.EnableBy.config
46
+ enableBy: () => Boolean(api.userConfig.utoopack)
52
47
  });
53
48
  api.onCheck(() => {
54
49
  (0, import_utils.checkVersion)(20, `Node 20 is required when using utoopack.`);
@@ -64,7 +59,16 @@ var utoopack_default = (api) => {
64
59
  return memo;
65
60
  });
66
61
  api.modifyConfig((memo, args) => {
67
- const rootDir = memo.rootDir ? (0, import_path.join)(args.paths.cwd, memo.rootDir).replace(/\/$/, "") : (0, import_bundler_utoopack.findRootDir)(args.paths.cwd).replace(/\/$/, "");
62
+ if (!api.userConfig.utoopack) {
63
+ return memo;
64
+ }
65
+ let rootDir;
66
+ try {
67
+ const { findRootDir } = require("@umijs/bundler-utoopack");
68
+ rootDir = memo.rootDir ? (0, import_path.join)(args.paths.cwd, memo.rootDir).replace(/\/$/, "") : findRootDir(args.paths.cwd).replace(/\/$/, "");
69
+ } catch (e) {
70
+ rootDir = memo.rootDir ? (0, import_path.join)(args.paths.cwd, memo.rootDir).replace(/\/$/, "") : args.paths.cwd.replace(/\/$/, "");
71
+ }
68
72
  memo.alias = {
69
73
  ...memo.alias,
70
74
  "@/*": `${args.paths.absSrcPath}/*`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.4.13-canary.20250915.2",
3
+ "version": "4.4.13-canary.20250915.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/babel-preset-umi": "4.4.13-canary.20250915.2",
47
- "@umijs/bundler-utils": "4.4.13-canary.20250915.2",
48
- "@umijs/bundler-vite": "4.4.13-canary.20250915.2",
49
- "@umijs/bundler-esbuild": "4.4.13-canary.20250915.2",
50
- "@umijs/ast": "4.4.13-canary.20250915.2",
51
- "@umijs/core": "4.4.13-canary.20250915.2",
52
- "@umijs/bundler-utoopack": "4.4.13-canary.20250915.2",
53
- "@umijs/plugin-run": "4.4.13-canary.20250915.2",
54
- "@umijs/renderer-react": "4.4.13-canary.20250915.2",
55
- "@umijs/bundler-webpack": "4.4.13-canary.20250915.2",
56
- "@umijs/mfsu": "4.4.13-canary.20250915.2",
57
- "@umijs/server": "4.4.13-canary.20250915.2",
58
- "@umijs/zod2ts": "4.4.13-canary.20250915.2",
59
- "@umijs/utils": "4.4.13-canary.20250915.2",
46
+ "@umijs/ast": "4.4.13-canary.20250915.3",
47
+ "@umijs/babel-preset-umi": "4.4.13-canary.20250915.3",
48
+ "@umijs/bundler-utoopack": "4.4.13-canary.20250915.3",
49
+ "@umijs/bundler-esbuild": "4.4.13-canary.20250915.3",
50
+ "@umijs/bundler-vite": "4.4.13-canary.20250915.3",
51
+ "@umijs/bundler-utils": "4.4.13-canary.20250915.3",
52
+ "@umijs/plugin-run": "4.4.13-canary.20250915.3",
53
+ "@umijs/bundler-webpack": "4.4.13-canary.20250915.3",
54
+ "@umijs/mfsu": "4.4.13-canary.20250915.3",
55
+ "@umijs/renderer-react": "4.4.13-canary.20250915.3",
56
+ "@umijs/core": "4.4.13-canary.20250915.3",
57
+ "@umijs/server": "4.4.13-canary.20250915.3",
58
+ "@umijs/utils": "4.4.13-canary.20250915.3",
59
+ "@umijs/zod2ts": "4.4.13-canary.20250915.3",
60
60
  "@umijs/ui": "3.0.1"
61
61
  },
62
62
  "devDependencies": {