-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix injected endpoint prerender detection (#12043)
- Loading branch information
Showing
8 changed files
with
73 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fixes injected endpoint `prerender` option detection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/astro/test/fixtures/ssr-manifest/astro.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import testAdapter from '../../test-adapter.js'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
export default defineConfig({ | ||
output: 'server', | ||
adapter: testAdapter(), | ||
integrations: [ | ||
{ | ||
name: 'test', | ||
hooks: { | ||
'astro:config:setup'({ injectRoute }) { | ||
injectRoute({ | ||
entrypoint: fileURLToPath(new URL('./entrypoint-test.js', import.meta.url)), | ||
pattern: '[...slug]', | ||
prerender: true, | ||
}); | ||
}, | ||
}, | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const prerender = true; | ||
|
||
export function getStaticPaths() { | ||
return [{ params: { slug: 'test' } }]; | ||
} | ||
|
||
export function GET() { | ||
return new Response('OK — test'); | ||
} |
17 changes: 0 additions & 17 deletions
17
packages/astro/test/fixtures/ssr-manifest/src/pages/index.astro
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
packages/astro/test/fixtures/ssr-manifest/src/pages/manifest.json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { manifest } from 'astro:ssr-manifest'; | ||
|
||
export function GET() { | ||
return Response.json(manifest); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters