@umijs/preset-umi 4.0.0-beta.17 → 4.0.0-beta.18
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/commands/plugin.js +0 -1
- package/dist/features/tmpFiles/routes.js +19 -5
- package/package.json +10 -10
package/dist/commands/plugin.js
CHANGED
|
@@ -31,12 +31,26 @@ function getRoutes(opts) {
|
|
|
31
31
|
prefix: '',
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
function localPath(path) {
|
|
35
|
+
if (path.charAt(0) !== '.') {
|
|
36
|
+
return `./${path}`;
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
return path;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
34
42
|
for (const id of Object.keys(routes)) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
if (routes[id].file) {
|
|
44
|
+
// TODO: cache for performance
|
|
45
|
+
const file = (0, path_1.isAbsolute)(routes[id].file)
|
|
46
|
+
? routes[id].file
|
|
47
|
+
: utils_1.resolve.sync(localPath(routes[id].file), {
|
|
48
|
+
basedir: ((_c = opts.api.config.conventionRoutes) === null || _c === void 0 ? void 0 : _c.base) ||
|
|
49
|
+
opts.api.paths.absPagesPath,
|
|
50
|
+
extensions: ['.js', '.jsx', '.tsx', '.ts'],
|
|
51
|
+
});
|
|
52
|
+
routes[id].__content = (0, fs_1.readFileSync)(file, 'utf-8');
|
|
53
|
+
}
|
|
40
54
|
}
|
|
41
55
|
// layout routes
|
|
42
56
|
const absLayoutPath = (0, path_1.join)(opts.api.paths.absSrcPath, 'layouts/index.tsx');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.18",
|
|
4
4
|
"description": "@umijs/preset-umi",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/preset-umi#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@types/multer": "1.4.7",
|
|
27
|
-
"@umijs/ast": "4.0.0-beta.
|
|
28
|
-
"@umijs/babel-preset-umi": "4.0.0-beta.
|
|
29
|
-
"@umijs/bundler-utils": "4.0.0-beta.
|
|
30
|
-
"@umijs/bundler-vite": "4.0.0-beta.
|
|
31
|
-
"@umijs/bundler-webpack": "4.0.0-beta.
|
|
32
|
-
"@umijs/core": "4.0.0-beta.
|
|
33
|
-
"@umijs/renderer-react": "4.0.0-beta.
|
|
34
|
-
"@umijs/server": "4.0.0-beta.
|
|
35
|
-
"@umijs/utils": "4.0.0-beta.
|
|
27
|
+
"@umijs/ast": "4.0.0-beta.18",
|
|
28
|
+
"@umijs/babel-preset-umi": "4.0.0-beta.18",
|
|
29
|
+
"@umijs/bundler-utils": "4.0.0-beta.18",
|
|
30
|
+
"@umijs/bundler-vite": "4.0.0-beta.18",
|
|
31
|
+
"@umijs/bundler-webpack": "4.0.0-beta.18",
|
|
32
|
+
"@umijs/core": "4.0.0-beta.18",
|
|
33
|
+
"@umijs/renderer-react": "4.0.0-beta.18",
|
|
34
|
+
"@umijs/server": "4.0.0-beta.18",
|
|
35
|
+
"@umijs/utils": "4.0.0-beta.18",
|
|
36
36
|
"core-js": "3.19.2",
|
|
37
37
|
"current-script-polyfill": "1.0.0",
|
|
38
38
|
"enhanced-resolve": "5.8.3",
|