0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Fix getViteConfig() type definition (#11046)

This commit is contained in:
HiDeoo 2024-05-15 10:04:47 +02:00 committed by GitHub
parent e90c98fea1
commit 086694ac31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Fixes `getViteConfig()` type definition to allow passing an inline Astro configuration as second argument

View file

@ -1,6 +1,7 @@
type ViteUserConfig = import('vite').UserConfig;
type ViteUserConfigFn = import('vite').UserConfigFn;
type AstroUserConfig = import('./dist/@types/astro.js').AstroUserConfig;
type AstroInlineConfig = import('./dist/@types/astro.js').AstroInlineConfig;
type ImageServiceConfig = import('./dist/@types/astro.js').ImageServiceConfig;
type SharpImageServiceConfig = import('./dist/assets/services/sharp.js').SharpImageServiceConfig;
@ -13,7 +14,10 @@ export function defineConfig(config: AstroUserConfig): AstroUserConfig;
/**
* Use Astro to generate a fully resolved Vite config
*/
export function getViteConfig(config: ViteUserConfig): ViteUserConfigFn;
export function getViteConfig(
config: ViteUserConfig,
inlineAstroConfig?: AstroInlineConfig
): ViteUserConfigFn;
/**
* Return the configuration needed to use the Sharp-based image service