@umijs/preset-umi 4.4.13-canary.20250915.1 → 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}/*`,
@@ -136,10 +136,9 @@ var registerMethods_default = (api) => {
136
136
  content.trim(),
137
137
  ""
138
138
  ].filter((text) => text !== false).join("\n");
139
- const isUtoopack = api.appData.bundler === "utoopack";
140
- if ((api.appData.vite || isUtoopack) && isJsFile) {
139
+ if (api.appData.vite && isJsFile) {
141
140
  const transformIEAR = transformModule.default;
142
- content = transformIEAR({ content, path: absPath }, api, isUtoopack);
141
+ content = transformIEAR({ content, path: absPath }, api);
143
142
  }
144
143
  if (!(0, import_fs.existsSync)(absPath)) {
145
144
  (0, import_fs.writeFileSync)(absPath, content, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/preset-umi",
3
- "version": "4.4.13-canary.20250915.1",
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/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",
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": {