mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
feat(vercel): Edge improvements (#5086)
* Added error on "output" == "static" * Minify output * Changeset
This commit is contained in:
parent
ddfbef5acb
commit
f8198d2502
2 changed files with 15 additions and 0 deletions
5
.changeset/hot-dogs-leave.md
Normal file
5
.changeset/hot-dogs-leave.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/vercel': minor
|
||||
---
|
||||
|
||||
Minify Edge Function output to save space
|
|
@ -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 }) => {
|
||||
|
|
Loading…
Reference in a new issue