diff --git a/.changeset/hot-dogs-leave.md b/.changeset/hot-dogs-leave.md new file mode 100644 index 0000000000..8083222095 --- /dev/null +++ b/.changeset/hot-dogs-leave.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': minor +--- + +Minify Edge Function output to save space diff --git a/packages/integrations/vercel/src/edge/adapter.ts b/packages/integrations/vercel/src/edge/adapter.ts index 018ab70326..c842cb38ff 100644 --- a/packages/integrations/vercel/src/edge/adapter.ts +++ b/packages/integrations/vercel/src/edge/adapter.ts @@ -39,6 +39,13 @@ export default function vercelEdge(): AstroIntegration { _config = config; serverEntry = config.build.serverEntry; functionFolder = config.build.server; + + if (config.output === 'static') { + throw new Error(` + [@astrojs/vercel] \`output: "server"\` is required to use the edge adapter. + + `); + } }, 'astro:build:start': ({ buildConfig }) => { if (needsBuildConfig) { @@ -66,6 +73,9 @@ export default function vercelEdge(): AstroIntegration { target: 'webworker', noExternal: true, }; + + vite.build ||= {}; + vite.build.minify = true; } }, 'astro:build:done': async ({ routes }) => {