mirror of
https://github.com/withastro/astro.git
synced 2025-03-10 23:01:26 -05:00
Align adapter setup (#6874)
This commit is contained in:
parent
1811616104
commit
27aa304ab4
1 changed files with 8 additions and 3 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue