@umijs/bundler-utoopack 4.0.0-canary.20251102.1 → 4.0.0-canary.20251110.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.
- package/dist/config.js +17 -10
- package/package.json +5 -5
package/dist/config.js
CHANGED
|
@@ -50,7 +50,13 @@ function convertProcessEnvForUtoopack(webpackConfig) {
|
|
|
50
50
|
function getModularizeImports(extraBabelPlugins) {
|
|
51
51
|
return extraBabelPlugins.filter((p) => /^import$|babel-plugin-import/.test(p[0])).reduce(
|
|
52
52
|
(acc, [_, v]) => {
|
|
53
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
libraryName,
|
|
55
|
+
libraryDirectory,
|
|
56
|
+
style,
|
|
57
|
+
camel2DashComponentName,
|
|
58
|
+
...rest
|
|
59
|
+
} = v;
|
|
54
60
|
if (Object.keys(rest).length > 0) {
|
|
55
61
|
throw new Error(
|
|
56
62
|
`babel-plugin-import options ${Object.keys(
|
|
@@ -63,8 +69,12 @@ function getModularizeImports(extraBabelPlugins) {
|
|
|
63
69
|
`babel-plugin-import style function is not supported in utoopack bundler`
|
|
64
70
|
);
|
|
65
71
|
}
|
|
72
|
+
let transformRule = "{{ kebabCase member }}";
|
|
73
|
+
if (camel2DashComponentName === false) {
|
|
74
|
+
transformRule = "{{ member }}";
|
|
75
|
+
}
|
|
66
76
|
acc[libraryName] = {
|
|
67
|
-
transform: `${libraryName}/${libraryDirectory}
|
|
77
|
+
transform: `${libraryName}/${libraryDirectory}/${transformRule}`,
|
|
68
78
|
preventFullImport: false,
|
|
69
79
|
skipDefaultConversion: false,
|
|
70
80
|
style: typeof style === "boolean" ? "style" : style
|
|
@@ -76,14 +86,11 @@ function getModularizeImports(extraBabelPlugins) {
|
|
|
76
86
|
}
|
|
77
87
|
function getNormalizedAlias(alias, rootDir) {
|
|
78
88
|
const newAlias = { ...alias };
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
if (newAlias["@@"]) {
|
|
86
|
-
newAlias["@@/*"] = `${newAlias["@@"]}/*`;
|
|
89
|
+
const keysToExpand = ["react", "react-dom", "@", "@@"];
|
|
90
|
+
for (const key of keysToExpand) {
|
|
91
|
+
if (newAlias[key]) {
|
|
92
|
+
newAlias[`${key}/*`] = `${newAlias[key]}/*`;
|
|
93
|
+
}
|
|
87
94
|
}
|
|
88
95
|
newAlias[`${rootDir}/*`] = `${rootDir}/*`;
|
|
89
96
|
return newAlias;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-utoopack",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20251110.1",
|
|
4
4
|
"description": "@umijs/bundler-utoopack",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"cors": "^2.8.5",
|
|
14
14
|
"express": "^4.18.2",
|
|
15
15
|
"express-http-proxy": "^2.1.1",
|
|
16
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
17
|
-
"@umijs/bundler-webpack": "4.0.0-canary.
|
|
16
|
+
"@umijs/bundler-utils": "4.0.0-canary.20251110.1",
|
|
17
|
+
"@umijs/bundler-webpack": "4.0.0-canary.20251110.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@utoo/pack": "^0.0.1-alpha.
|
|
20
|
+
"@utoo/pack": "^0.0.1-alpha.62",
|
|
21
21
|
"father": "4.1.5"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@utoo/pack": "^0.0.1-alpha.
|
|
24
|
+
"@utoo/pack": "^0.0.1-alpha.62"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|