diff --git a/packages/vite/src/node/__tests__/config.spec.ts b/packages/vite/src/node/__tests__/config.spec.ts index e84f71d7f5dac7..b4196af570d207 100644 --- a/packages/vite/src/node/__tests__/config.spec.ts +++ b/packages/vite/src/node/__tests__/config.spec.ts @@ -7,7 +7,7 @@ import { mergeConfig } from '../publicUtils' describe('mergeConfig', () => { test('handles configs with different alias schemas', () => { - const baseConfig: UserConfigExport = { + const baseConfig = defineConfig({ resolve: { alias: [ { @@ -16,16 +16,16 @@ describe('mergeConfig', () => { }, ], }, - } + }) - const newConfig: UserConfigExport = { + const newConfig = defineConfig({ resolve: { alias: { bar: 'bar-value', baz: 'baz-value', }, }, - } + }) const mergedConfig: UserConfigExport = { resolve: { diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index b9442a3305b743..a0df3907252804 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -109,7 +109,7 @@ export type UserConfigExport = UserConfig | Promise | UserConfigFn * The function receives a {@link ConfigEnv} object that exposes two properties: * `command` (either `'build'` or `'serve'`), and `mode`. */ -export function defineConfig(config: UserConfigExport): UserConfigExport { +export function defineConfig(config: T): T { return config }