Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jan 17, 2025
1 parent 858b94f commit cf79469
Showing 1 changed file with 35 additions and 24 deletions.
59 changes: 35 additions & 24 deletions packages/vercel/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,32 +215,44 @@ export default function vercelAdapter({
format: 'directory',
redirects: false,
},
integrations: [{
name: 'astro:copy-vercel-output',
hooks: {
'astro:build:done': async ({ logger }: HookParameters<'astro:build:done'>) => {
if (staticDir) {
if (existsSync(staticDir)) {
emptyDir(staticDir);
}
mkdirSync(new URL('./.vercel/output/static/', _config.root), { recursive: true });

if (_buildOutput === 'static' && staticDir) {
cpSync(_config.outDir, new URL('./.vercel/output/static/', _config.root), {
recursive: true,
});
} else {
cpSync(_config.build.client, new URL('./.vercel/output/static/', _config.root), {
recursive: true,
});
cpSync(_config.build.server, new URL('./.vercel/output/_functions/', _config.root), {
integrations: [
{
name: 'astro:copy-vercel-output',
hooks: {
'astro:build:done': async ({ logger }: HookParameters<'astro:build:done'>) => {
if (staticDir) {
if (existsSync(staticDir)) {
emptyDir(staticDir);
}
mkdirSync(new URL('./.vercel/output/static/', _config.root), {
recursive: true,
});

if (_buildOutput === 'static' && staticDir) {
cpSync(_config.outDir, new URL('./.vercel/output/static/', _config.root), {
recursive: true,
});
} else {
cpSync(
_config.build.client,
new URL('./.vercel/output/static/', _config.root),
{
recursive: true,
}
);
cpSync(
_config.build.server,
new URL('./.vercel/output/_functions/', _config.root),
{
recursive: true,
}
);
}
}
}
}
}
}],
},
},
},
],
vite: {
ssr: {
external: ['@vercel/nft'],
Expand All @@ -254,7 +266,6 @@ export default function vercelAdapter({
config.image
),
});

},
'astro:routes:resolved': (params) => {
routes = params.routes;
Expand Down

0 comments on commit cf79469

Please sign in to comment.