Skip to content

Commit

Permalink
fix: narrow defineConfig return type (#12021)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework authored Feb 14, 2023
1 parent 6a0d356 commit 18fa8f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFn
* The function receives a {@link ConfigEnv} object that exposes two properties:
* `command` (either `'build'` or `'serve'`), and `mode`.
*/
export function defineConfig(config: UserConfig): UserConfig
export function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>
export function defineConfig(config: UserConfigFn): UserConfigFn
export function defineConfig(config: UserConfigExport): UserConfigExport {
return config
}
Expand Down

0 comments on commit 18fa8f0

Please sign in to comment.