Updated hooks

This commit is contained in:
JuanM04 2022-03-30 21:51:37 -03:00
parent 20c3969a43
commit 09e8b8e502
No known key found for this signature in database
GPG key ID: 0171B712E406271A
2 changed files with 2 additions and 2 deletions

View file

@ -679,7 +679,7 @@ export interface AstroIntegration {
'astro:config:done'?: (options: { config: AstroConfig; setAdapter: (adapter: AstroAdapter) => void }) => void | Promise<void>;
'astro:server:setup'?: (options: { config: Readonly<AstroConfig>; server: vite.ViteDevServer }) => void | Promise<void>;
'astro:server:start'?: (options: { config: Readonly<AstroConfig>; address: AddressInfo }) => void | Promise<void>;
'astro:server:done'?: (options: {config: Readonly<AstroConfig>;}) => void | Promise<void>;
'astro:server:done'?: (options: { config: Readonly<AstroConfig> }) => void | Promise<void>;
'astro:build:start'?: (options: { config: Readonly<AstroConfig>; buildConfig: BuildConfig }) => void | Promise<void>;
'astro:build:setup'?: (options: { config: Readonly<AstroConfig>; vite: ViteConfigWithSSR; target: 'client' | 'server' }) => void;
'astro:build:done'?: (options: { config: Readonly<AstroConfig>; pages: { pathname: string }[]; dir: URL; routes: RouteData[] }) => void | Promise<void>;

View file

@ -95,7 +95,7 @@ export async function runHookBuildStart({ config, buildConfig }: { config: Astro
export async function runHookBuildSetup({ config, vite, target }: { config: AstroConfig; vite: ViteConfigWithSSR; target: 'server' | 'client' }) {
for (const integration of config.integrations) {
if (integration.hooks['astro:build:setup']) {
await integration.hooks['astro:build:setup']({ vite, target });
await integration.hooks['astro:build:setup']({ config, vite, target });
}
}
}