@umijs/bundler-utoopack 4.6.37 → 4.6.38

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.
Files changed (2) hide show
  1. package/dist/config.js +16 -2
  2. package/package.json +3 -3
package/dist/config.js CHANGED
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(config_exports);
36
36
  var import_bundler_webpack = require("@umijs/bundler-webpack");
37
37
  var import_utils = require("@umijs/utils");
38
38
  var import_pack = require("@utoo/pack");
39
+ var import_fs = __toESM(require("fs"));
39
40
  var import_path = require("path");
40
41
  function convertProcessEnvForUtoopack(webpackConfig) {
41
42
  var _a;
@@ -103,8 +104,21 @@ function getNormalizedAlias(alias, rootDir) {
103
104
  if (key.endsWith("/*") || value.endsWith("/*") || key.endsWith("/") || value.endsWith("/") || key.endsWith("$")) {
104
105
  continue;
105
106
  }
106
- if ((0, import_path.extname)(value)) {
107
- continue;
107
+ const ext = (0, import_path.extname)(value);
108
+ if (ext) {
109
+ let isDirectory = false;
110
+ const candidates = [.../* @__PURE__ */ new Set([value, (0, import_path.resolve)(rootDir, value)])];
111
+ for (const candidate of candidates) {
112
+ try {
113
+ const stat = import_fs.default.statSync(candidate);
114
+ if (stat.isDirectory()) {
115
+ isDirectory = true;
116
+ break;
117
+ }
118
+ } catch (e) {
119
+ }
120
+ }
121
+ if (!isDirectory) continue;
108
122
  }
109
123
  newAlias[`${key}/*`] = `${value}/*`;
110
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-utoopack",
3
- "version": "4.6.37",
3
+ "version": "4.6.38",
4
4
  "description": "@umijs/bundler-utoopack",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,8 +19,8 @@
19
19
  "postcss": "^8.4.21",
20
20
  "sass": "1.54.0",
21
21
  "sass-loader": "13.2.0",
22
- "@umijs/bundler-webpack": "4.6.37",
23
- "@umijs/bundler-utils": "4.6.37"
22
+ "@umijs/bundler-utils": "4.6.38",
23
+ "@umijs/bundler-webpack": "4.6.38"
24
24
  },
25
25
  "devDependencies": {
26
26
  "father": "4.1.5"