Skip to content

Commit

Permalink
Align adapter setup (#6874)
Browse files Browse the repository at this point in the history
  • Loading branch information
nblackburn authored Apr 19, 2023
1 parent 1811616 commit 27aa304
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/integrations/vercel/src/static/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ export default function vercelStatic({ analytics }: VercelStaticConfig = {}): As
return {
name: '@astrojs/vercel',
hooks: {
'astro:config:setup': ({ command, config, injectScript }) => {
'astro:config:setup': ({ command, config, updateConfig, injectScript }) => {
if (command === 'build' && analytics) {
injectScript('page', 'import "@astrojs/vercel/analytics"');
}
config.outDir = new URL('./static/', getVercelOutput(config.root));
config.build.format = 'directory';
const outDir = new URL('./static/', getVercelOutput(config.root));
updateConfig({
outDir,
build: {
format: 'directory',
},
});
},
'astro:config:done': ({ setAdapter, config }) => {
setAdapter(getAdapter());
Expand Down

0 comments on commit 27aa304

Please sign in to comment.