@modern-js/plugin-router-v5 2.60.5 → 2.60.6-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -71,8 +71,8 @@ const routerPlugin = (userConfig = {}) => {
|
|
71
71
|
return (props) => {
|
72
72
|
var _window__SERVER_DATA;
|
73
73
|
const runtimeContext = (0, import_react.useContext)(import_runtime.RuntimeReactContext);
|
74
|
-
const baseUrl = (
|
75
|
-
const basename = baseUrl === "/" ? (0, import_utils.urlJoin)(baseUrl, historyOptions.basename) : baseUrl;
|
74
|
+
const baseUrl = (((_window__SERVER_DATA = window._SERVER_DATA) === null || _window__SERVER_DATA === void 0 ? void 0 : _window__SERVER_DATA.router.baseUrl) || select(location.pathname)).replace(/^\/*/, "/");
|
75
|
+
const basename = baseUrl === "/" ? (0, import_utils.urlJoin)(baseUrl, runtimeContext._internalRouterBaseName || historyOptions.basename) : baseUrl;
|
76
76
|
historyOptions.basename = basename;
|
77
77
|
const history = customHistory || (supportHtml5History ? (0, import_history.createBrowserHistory)(historyOptions) : (0, import_history.createHashHistory)(historyOptions));
|
78
78
|
const runner = api.useHookRunners();
|
@@ -53,8 +53,8 @@ var routerPlugin = function() {
|
|
53
53
|
return function(props) {
|
54
54
|
var _window__SERVER_DATA;
|
55
55
|
var runtimeContext = useContext(RuntimeReactContext);
|
56
|
-
var baseUrl = (
|
57
|
-
var basename = baseUrl === "/" ? urlJoin(baseUrl, historyOptions.basename) : baseUrl;
|
56
|
+
var baseUrl = (((_window__SERVER_DATA = window._SERVER_DATA) === null || _window__SERVER_DATA === void 0 ? void 0 : _window__SERVER_DATA.router.baseUrl) || select(location.pathname)).replace(/^\/*/, "/");
|
57
|
+
var basename = baseUrl === "/" ? urlJoin(baseUrl, runtimeContext._internalRouterBaseName || historyOptions.basename) : baseUrl;
|
58
58
|
historyOptions.basename = basename;
|
59
59
|
var history = customHistory || (supportHtml5History ? createBrowserHistory(historyOptions) : createHashHistory(historyOptions));
|
60
60
|
var runner = api.useHookRunners();
|
@@ -48,8 +48,8 @@ const routerPlugin = (userConfig = {}) => {
|
|
48
48
|
return (props) => {
|
49
49
|
var _window__SERVER_DATA;
|
50
50
|
const runtimeContext = useContext(RuntimeReactContext);
|
51
|
-
const baseUrl = (
|
52
|
-
const basename = baseUrl === "/" ? urlJoin(baseUrl, historyOptions.basename) : baseUrl;
|
51
|
+
const baseUrl = (((_window__SERVER_DATA = window._SERVER_DATA) === null || _window__SERVER_DATA === void 0 ? void 0 : _window__SERVER_DATA.router.baseUrl) || select(location.pathname)).replace(/^\/*/, "/");
|
52
|
+
const basename = baseUrl === "/" ? urlJoin(baseUrl, runtimeContext._internalRouterBaseName || historyOptions.basename) : baseUrl;
|
53
53
|
historyOptions.basename = basename;
|
54
54
|
const history = customHistory || (supportHtml5History ? createBrowserHistory(historyOptions) : createHashHistory(historyOptions));
|
55
55
|
const runner = api.useHookRunners();
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.60.
|
18
|
+
"version": "2.60.6-alpha.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
21
21
|
"main": "./dist/cjs/cli/index.js",
|
@@ -61,8 +61,8 @@
|
|
61
61
|
"react-router-dom": "^5.3.4",
|
62
62
|
"@modern-js/plugin": "2.60.5",
|
63
63
|
"@modern-js/runtime-utils": "2.60.5",
|
64
|
-
"@modern-js/
|
65
|
-
"@modern-js/
|
64
|
+
"@modern-js/utils": "2.60.5",
|
65
|
+
"@modern-js/types": "2.60.5"
|
66
66
|
},
|
67
67
|
"peerDependencies": {
|
68
68
|
"react": ">=17",
|
@@ -79,17 +79,16 @@
|
|
79
79
|
"react-dom": "^18.3.1",
|
80
80
|
"ts-jest": "^29.1.0",
|
81
81
|
"typescript": "^5",
|
82
|
+
"@scripts/build": "2.60.5",
|
82
83
|
"@modern-js/app-tools": "2.60.5",
|
83
|
-
"@modern-js/core": "2.60.5",
|
84
84
|
"@modern-js/runtime": "2.60.5",
|
85
|
-
"@scripts/
|
86
|
-
"@
|
85
|
+
"@scripts/jest-config": "2.60.5",
|
86
|
+
"@modern-js/core": "2.60.5"
|
87
87
|
},
|
88
88
|
"sideEffects": false,
|
89
89
|
"publishConfig": {
|
90
90
|
"registry": "https://registry.npmjs.org/",
|
91
|
-
"access": "public"
|
92
|
-
"provenance": true
|
91
|
+
"access": "public"
|
93
92
|
},
|
94
93
|
"scripts": {
|
95
94
|
"dev": "modern-lib build --watch",
|