mirror of
https://github.com/withastro/astro.git
synced 2025-03-10 23:01:26 -05:00
Handle base
in adapters (#5290)
* Handle `base` in adapters * Use removeBase in the test adapter * Update packages/integrations/node/src/preview.ts Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * Update packages/integrations/cloudflare/src/server.advanced.ts Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * Include the subpath for links Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
This commit is contained in:
parent
c5180f2540
commit
5a4e4f4588
3 changed files with 5 additions and 2 deletions
|
@ -36,6 +36,9 @@
|
|||
"dependencies": {
|
||||
"esbuild": "^0.14.42"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^1.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "workspace:*",
|
||||
"astro-scripts": "workspace:*",
|
||||
|
|
|
@ -16,7 +16,7 @@ export function createExports(manifest: SSRManifest) {
|
|||
|
||||
// static assets
|
||||
if (manifest.assets.has(pathname)) {
|
||||
const assetRequest = new Request(`${origin}/static${pathname}`, request);
|
||||
const assetRequest = new Request(`${origin}/static/${app.removeBase(pathname)}`, request);
|
||||
return env.ASSETS.fetch(assetRequest);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ export function createExports(manifest: SSRManifest) {
|
|||
const { origin, pathname } = new URL(request.url);
|
||||
// static assets
|
||||
if (manifest.assets.has(pathname)) {
|
||||
const assetRequest = new Request(`${origin}/static${pathname}`, request);
|
||||
const assetRequest = new Request(`${origin}/static/${app.removeBase(pathname)}`, request);
|
||||
return next(assetRequest);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue