@modern-js/app-tools 2.28.1-alpha.2 → 2.28.1-alpha.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.
|
@@ -68,11 +68,16 @@ const optimizeRoute = (routeTree) => {
|
|
|
68
68
|
const { children } = routeTree;
|
|
69
69
|
if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config) {
|
|
70
70
|
const newRoutes = children.map((child) => {
|
|
71
|
-
const routePath = `${routeTree.path}${child.path ? `/${child.path}` : ""}`;
|
|
71
|
+
const routePath = `${routeTree.path ? routeTree.path : ""}${child.path ? `/${child.path}` : ""}`;
|
|
72
72
|
const newRoute = {
|
|
73
73
|
...child,
|
|
74
74
|
path: routePath.replace(/\/\//g, "/")
|
|
75
75
|
};
|
|
76
|
+
if (routePath.length > 0) {
|
|
77
|
+
delete newRoute.index;
|
|
78
|
+
} else {
|
|
79
|
+
delete newRoute.path;
|
|
80
|
+
}
|
|
76
81
|
return newRoute;
|
|
77
82
|
});
|
|
78
83
|
return Array.from(new Set(newRoutes)).flatMap(optimizeRoute);
|
|
@@ -47,10 +47,15 @@ export var optimizeRoute = function(routeTree) {
|
|
|
47
47
|
var children = routeTree.children;
|
|
48
48
|
if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config) {
|
|
49
49
|
var newRoutes = children.map(function(child) {
|
|
50
|
-
var routePath = "".concat(routeTree.path).concat(child.path ? "/".concat(child.path) : "");
|
|
50
|
+
var routePath = "".concat(routeTree.path ? routeTree.path : "").concat(child.path ? "/".concat(child.path) : "");
|
|
51
51
|
var newRoute = _object_spread_props(_object_spread({}, child), {
|
|
52
52
|
path: routePath.replace(/\/\//g, "/")
|
|
53
53
|
});
|
|
54
|
+
if (routePath.length > 0) {
|
|
55
|
+
delete newRoute.index;
|
|
56
|
+
} else {
|
|
57
|
+
delete newRoute.path;
|
|
58
|
+
}
|
|
54
59
|
return newRoute;
|
|
55
60
|
});
|
|
56
61
|
return Array.from(new Set(newRoutes)).flatMap(optimizeRoute);
|
|
@@ -45,11 +45,16 @@ export const optimizeRoute = (routeTree) => {
|
|
|
45
45
|
const { children } = routeTree;
|
|
46
46
|
if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config) {
|
|
47
47
|
const newRoutes = children.map((child) => {
|
|
48
|
-
const routePath = `${routeTree.path}${child.path ? `/${child.path}` : ""}`;
|
|
48
|
+
const routePath = `${routeTree.path ? routeTree.path : ""}${child.path ? `/${child.path}` : ""}`;
|
|
49
49
|
const newRoute = {
|
|
50
50
|
...child,
|
|
51
51
|
path: routePath.replace(/\/\//g, "/")
|
|
52
52
|
};
|
|
53
|
+
if (routePath.length > 0) {
|
|
54
|
+
delete newRoute.index;
|
|
55
|
+
} else {
|
|
56
|
+
delete newRoute.path;
|
|
57
|
+
}
|
|
53
58
|
return newRoute;
|
|
54
59
|
});
|
|
55
60
|
return Array.from(new Set(newRoutes)).flatMap(optimizeRoute);
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.28.1-alpha.
|
|
18
|
+
"version": "2.28.1-alpha.3",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -74,22 +74,22 @@
|
|
|
74
74
|
"rspack-plugin-virtual-module": "0.1.0",
|
|
75
75
|
"@swc/helpers": "0.5.1",
|
|
76
76
|
"@modern-js/builder": "2.28.0",
|
|
77
|
+
"@modern-js/builder-plugin-node-polyfill": "2.28.0",
|
|
77
78
|
"@modern-js/builder-shared": "2.28.0",
|
|
78
|
-
"@modern-js/
|
|
79
|
+
"@modern-js/new-action": "2.28.0",
|
|
79
80
|
"@modern-js/core": "2.28.0",
|
|
80
|
-
"@modern-js/node-bundle-require": "2.28.0",
|
|
81
81
|
"@modern-js/plugin": "2.28.0",
|
|
82
82
|
"@modern-js/builder-plugin-esbuild": "2.28.0",
|
|
83
|
-
"@modern-js/builder-plugin-node-polyfill": "2.28.0",
|
|
84
|
-
"@modern-js/types": "2.28.0",
|
|
85
|
-
"@modern-js/plugin-i18n": "2.28.0",
|
|
86
83
|
"@modern-js/prod-server": "2.28.0",
|
|
87
|
-
"@modern-js/
|
|
88
|
-
"@modern-js/server-core": "2.28.0",
|
|
89
|
-
"@modern-js/upgrade": "2.28.0",
|
|
84
|
+
"@modern-js/builder-webpack-provider": "2.28.0",
|
|
90
85
|
"@modern-js/server": "2.28.0",
|
|
86
|
+
"@modern-js/upgrade": "2.28.0",
|
|
87
|
+
"@modern-js/node-bundle-require": "2.28.0",
|
|
88
|
+
"@modern-js/plugin-i18n": "2.28.0",
|
|
89
|
+
"@modern-js/types": "2.28.0",
|
|
90
|
+
"@modern-js/utils": "2.28.0",
|
|
91
91
|
"@modern-js/plugin-lint": "2.28.0",
|
|
92
|
-
"@modern-js/
|
|
92
|
+
"@modern-js/server-core": "2.28.0",
|
|
93
93
|
"@modern-js/plugin-data-loader": "2.28.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
@@ -99,10 +99,10 @@
|
|
|
99
99
|
"jest": "^29",
|
|
100
100
|
"typescript": "^5",
|
|
101
101
|
"webpack": "^5.88.1",
|
|
102
|
-
"@
|
|
103
|
-
"@modern-js/builder-rspack-provider": "2.28.0",
|
|
102
|
+
"@modern-js/builder-plugin-swc": "2.28.0",
|
|
104
103
|
"@scripts/jest-config": "2.28.0",
|
|
105
|
-
"@modern-js/builder-
|
|
104
|
+
"@modern-js/builder-rspack-provider": "2.28.0",
|
|
105
|
+
"@scripts/build": "2.28.0"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"@modern-js/builder-rspack-provider": "^2.28.0"
|