From a6c2990df8691ea0194e6cd3bdd346345927947b Mon Sep 17 00:00:00 2001 From: HiDeoo <494699+HiDeoo@users.noreply.github.com> Date: Wed, 15 May 2024 00:18:49 +0200 Subject: [PATCH] fix: `getViteConfig()` second argument type definition --- .changeset/popular-colts-happen.md | 5 +++++ packages/astro/config.d.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/popular-colts-happen.md diff --git a/.changeset/popular-colts-happen.md b/.changeset/popular-colts-happen.md new file mode 100644 index 000000000000..1d90d2263303 --- /dev/null +++ b/.changeset/popular-colts-happen.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes `getViteConfig()` type definition to allow passing an inline Astro configuration as second argument diff --git a/packages/astro/config.d.ts b/packages/astro/config.d.ts index b859f0b055fc..47bf6ed61908 100644 --- a/packages/astro/config.d.ts +++ b/packages/astro/config.d.ts @@ -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