Skip to content

Commit 18fa8f0

Browse files
authoredFeb 14, 2023
fix: narrow defineConfig return type (#12021)
1 parent 6a0d356 commit 18fa8f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎packages/vite/src/node/config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ export type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFn
104104
* The function receives a {@link ConfigEnv} object that exposes two properties:
105105
* `command` (either `'build'` or `'serve'`), and `mode`.
106106
*/
107+
export function defineConfig(config: UserConfig): UserConfig
108+
export function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>
109+
export function defineConfig(config: UserConfigFn): UserConfigFn
107110
export function defineConfig(config: UserConfigExport): UserConfigExport {
108111
return config
109112
}

0 commit comments

Comments
 (0)