diff --git a/.changeset/poor-steaks-confess.md b/.changeset/poor-steaks-confess.md new file mode 100644 index 000000000000..254375c6ad41 --- /dev/null +++ b/.changeset/poor-steaks-confess.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': patch +--- + +Prevents the Vercel serverless adapter from generating static redirect pages in hybrid mode diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts index e7cdebfb971c..ea7cd7e533f8 100644 --- a/packages/integrations/vercel/src/serverless/adapter.ts +++ b/packages/integrations/vercel/src/serverless/adapter.ts @@ -175,6 +175,7 @@ export default function vercelServerless({ serverEntry: 'entry.mjs', client: new URL('./static/', outDir), server: new URL('./dist/', config.root), + redirects: false, }, vite: { ...getSpeedInsightsViteConfig(speedInsights?.enabled || analytics), diff --git a/packages/integrations/vercel/test/fixtures/redirects-serverless/astro.config.mjs b/packages/integrations/vercel/test/fixtures/redirects-serverless/astro.config.mjs new file mode 100644 index 000000000000..37b08d2d7744 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects-serverless/astro.config.mjs @@ -0,0 +1,7 @@ +import { defineConfig } from 'astro/config'; +import vercel from '@astrojs/vercel/serverless'; + +export default defineConfig({ + output: 'hybrid', + adapter: vercel(), +}); diff --git a/packages/integrations/vercel/test/fixtures/redirects-serverless/package.json b/packages/integrations/vercel/test/fixtures/redirects-serverless/package.json new file mode 100644 index 000000000000..c8de30d66c33 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects-serverless/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-redirects-serverless", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "workspace:*" + } +} diff --git a/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/index.astro new file mode 100644 index 000000000000..9c077e2a381b --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/index.astro @@ -0,0 +1,8 @@ + +
+