@umijs/preset-umi 4.0.18 → 4.0.19
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.
|
@@ -34,6 +34,7 @@ function getSchemas() {
|
|
|
34
34
|
history: (Joi) => Joi.object({
|
|
35
35
|
type: Joi.string().valid("browser", "hash", "memory")
|
|
36
36
|
}),
|
|
37
|
+
historyWithQuery: (Joi) => Joi.object(),
|
|
37
38
|
links: (Joi) => Joi.array(),
|
|
38
39
|
metas: (Joi) => Joi.array(),
|
|
39
40
|
mountElementId: (Joi) => Joi.string(),
|
|
@@ -88,7 +88,12 @@ var tmpFiles_default = (api) => {
|
|
|
88
88
|
} : {}
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
|
-
include: [
|
|
91
|
+
include: [
|
|
92
|
+
`${baseUrl}.umirc.ts`,
|
|
93
|
+
`${baseUrl}**/*.d.ts`,
|
|
94
|
+
`${baseUrl}**/*.ts`,
|
|
95
|
+
`${baseUrl}**/*.tsx`
|
|
96
|
+
]
|
|
92
97
|
}, null, 2)
|
|
93
98
|
});
|
|
94
99
|
api.writeTmpFile({
|
|
@@ -388,12 +393,13 @@ export default function EmptyRoute() {
|
|
|
388
393
|
});
|
|
389
394
|
}
|
|
390
395
|
if (api.appData.framework === "react") {
|
|
396
|
+
const historyPath = api.config.historyWithQuery ? (0, import_utils.winPath)((0, import_path.dirname)(require.resolve("@umijs/history/package.json"))) : rendererPath;
|
|
391
397
|
api.writeTmpFile({
|
|
392
398
|
noPluginDir: true,
|
|
393
399
|
path: "core/history.ts",
|
|
394
400
|
tplPath: (0, import_path.join)(import_constants.TEMPLATES_DIR, "history.tpl"),
|
|
395
401
|
context: {
|
|
396
|
-
|
|
402
|
+
historyPath
|
|
397
403
|
}
|
|
398
404
|
});
|
|
399
405
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/preset-umi",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.19",
|
|
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",
|
|
@@ -26,18 +26,19 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@types/multer": "1.4.7",
|
|
29
|
-
"@umijs/ast": "4.0.
|
|
30
|
-
"@umijs/babel-preset-umi": "4.0.
|
|
31
|
-
"@umijs/bundler-utils": "4.0.
|
|
32
|
-
"@umijs/bundler-vite": "4.0.
|
|
33
|
-
"@umijs/bundler-webpack": "4.0.
|
|
34
|
-
"@umijs/core": "4.0.
|
|
29
|
+
"@umijs/ast": "4.0.19",
|
|
30
|
+
"@umijs/babel-preset-umi": "4.0.19",
|
|
31
|
+
"@umijs/bundler-utils": "4.0.19",
|
|
32
|
+
"@umijs/bundler-vite": "4.0.19",
|
|
33
|
+
"@umijs/bundler-webpack": "4.0.19",
|
|
34
|
+
"@umijs/core": "4.0.19",
|
|
35
35
|
"@umijs/did-you-know": "^1.0.0",
|
|
36
|
-
"@umijs/
|
|
37
|
-
"@umijs/
|
|
38
|
-
"@umijs/
|
|
39
|
-
"@umijs/
|
|
40
|
-
"@umijs/
|
|
36
|
+
"@umijs/history": "5.3.0",
|
|
37
|
+
"@umijs/mfsu": "4.0.19",
|
|
38
|
+
"@umijs/plugin-run": "4.0.19",
|
|
39
|
+
"@umijs/renderer-react": "4.0.19",
|
|
40
|
+
"@umijs/server": "4.0.19",
|
|
41
|
+
"@umijs/utils": "4.0.19",
|
|
41
42
|
"click-to-react-component": "^1.0.8",
|
|
42
43
|
"core-js": "3.22.4",
|
|
43
44
|
"current-script-polyfill": "1.0.0",
|
package/templates/history.tpl
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHashHistory, createMemoryHistory, createBrowserHistory, History } from '{{{
|
|
1
|
+
import { createHashHistory, createMemoryHistory, createBrowserHistory, History } from '{{{ historyPath }}}';
|
|
2
2
|
|
|
3
3
|
let history: History;
|
|
4
4
|
let basename: string = '/';
|
|
@@ -14,15 +14,15 @@ export function createHistory(opts: any) {
|
|
|
14
14
|
if (opts.basename) {
|
|
15
15
|
basename = opts.basename;
|
|
16
16
|
}
|
|
17
|
-
history =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
17
|
+
history = h;
|
|
18
|
+
const oldPush = h.push;
|
|
19
|
+
history.push = (to, state) => {
|
|
20
|
+
oldPush(patchTo(to), state);
|
|
21
|
+
};
|
|
22
|
+
const oldReplace = h.replace;
|
|
23
|
+
history.replace = (to, state) => {
|
|
24
|
+
oldReplace(patchTo(to), state);
|
|
25
|
+
};
|
|
26
26
|
return h;
|
|
27
27
|
}
|
|
28
28
|
|