0
Fork 0
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:
Matthew Phillips 2022-11-07 10:05:12 -05:00 committed by GitHub
parent c5180f2540
commit 5a4e4f4588
3 changed files with 5 additions and 2 deletions

View file

@ -36,6 +36,9 @@
"dependencies": {
"esbuild": "^0.14.42"
},
"peerDependencies": {
"astro": "^1.6.3"
},
"devDependencies": {
"astro": "workspace:*",
"astro-scripts": "workspace:*",

View file

@ -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);
}

View file

@ -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);
}