Skip to content

Commit 086694a

Browse files
authoredMay 15, 2024··
Fix getViteConfig() type definition (#11046)
1 parent e90c98f commit 086694a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎.changeset/popular-colts-happen.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"astro": patch
3+
---
4+
5+
Fixes `getViteConfig()` type definition to allow passing an inline Astro configuration as second argument

‎packages/astro/config.d.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
type ViteUserConfig = import('vite').UserConfig;
22
type ViteUserConfigFn = import('vite').UserConfigFn;
33
type AstroUserConfig = import('./dist/@types/astro.js').AstroUserConfig;
4+
type AstroInlineConfig = import('./dist/@types/astro.js').AstroInlineConfig;
45
type ImageServiceConfig = import('./dist/@types/astro.js').ImageServiceConfig;
56
type SharpImageServiceConfig = import('./dist/assets/services/sharp.js').SharpImageServiceConfig;
67

@@ -13,7 +14,10 @@ export function defineConfig(config: AstroUserConfig): AstroUserConfig;
1314
/**
1415
* Use Astro to generate a fully resolved Vite config
1516
*/
16-
export function getViteConfig(config: ViteUserConfig): ViteUserConfigFn;
17+
export function getViteConfig(
18+
config: ViteUserConfig,
19+
inlineAstroConfig?: AstroInlineConfig
20+
): ViteUserConfigFn;
1721

1822
/**
1923
* Return the configuration needed to use the Sharp-based image service

0 commit comments

Comments
 (0)
Please sign in to comment.