@umijs/server
Advanced tools
Comparing version 4.0.0-canary.20240903.3 to 4.0.0-canary.20240909.1
@@ -35,2 +35,3 @@ /// <reference lib="webworker" /> | ||
mountElementId: string; | ||
basename?: string; | ||
} | ||
@@ -37,0 +38,0 @@ export declare function createMarkupGenerator(opts: CreateRequestHandlerOptions): (url: string) => Promise<unknown>; |
@@ -75,3 +75,4 @@ var __create = Object.create; | ||
createHistory, | ||
sourceDir | ||
sourceDir, | ||
basename | ||
} = opts; | ||
@@ -88,3 +89,3 @@ createHistory({ type: "memory", initialEntries: [url], initialIndex: 1 }); | ||
}); | ||
const matches = matchRoutesForSSR(url, routes); | ||
const matches = matchRoutesForSSR(url, routes, basename); | ||
if (matches.length === 0) { | ||
@@ -131,3 +132,4 @@ return; | ||
__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: opts.__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, | ||
mountElementId: opts.mountElementId | ||
mountElementId: opts.mountElementId, | ||
basename | ||
}; | ||
@@ -459,5 +461,6 @@ const element = await opts.getClientRootComponent( | ||
} | ||
function matchRoutesForSSR(reqUrl, routesById) { | ||
function matchRoutesForSSR(reqUrl, routesById, basename) { | ||
var _a; | ||
return ((_a = (0, import_react_router_dom.matchRoutes)(createClientRoutes({ routesById }), reqUrl)) == null ? void 0 : _a.map( | ||
const _basename = (basename == null ? void 0 : basename.endsWith("/")) ? basename.slice(0, -1) : basename; | ||
return ((_a = (0, import_react_router_dom.matchRoutes)(createClientRoutes({ routesById }), reqUrl, _basename)) == null ? void 0 : _a.map( | ||
(route) => route.route.id | ||
@@ -464,0 +467,0 @@ )) || []; |
{ | ||
"name": "@umijs/server", | ||
"version": "4.0.0-canary.20240903.3", | ||
"version": "4.0.0-canary.20240909.1", | ||
"description": "@umijs/server", | ||
@@ -22,3 +22,3 @@ "homepage": "https://github.com/umijs/umi/tree/master/packages/server#readme", | ||
"react-router-dom": "6.3.0", | ||
"@umijs/bundler-utils": "4.0.0-canary.20240903.3" | ||
"@umijs/bundler-utils": "4.0.0-canary.20240909.1" | ||
}, | ||
@@ -25,0 +25,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40254
1078
+ Added@umijs/bundler-utils@4.0.0-canary.20240909.1(transitive)
+ Added@umijs/utils@4.0.0-canary.20240909.1(transitive)
- Removed@umijs/bundler-utils@4.0.0-canary.20240903.3(transitive)
- Removed@umijs/utils@4.0.0-canary.20240903.3(transitive)