diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index f633d1158bfa95..a30d84465e9990 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -63,7 +63,7 @@ export function defineConfig(config: UserConfigExport): UserConfigExport { return config } -export type PluginOption = Plugin | false | null | undefined +export type PluginOption = Plugin | false | null | undefined | PluginOption[] export interface UserConfig { /** @@ -109,7 +109,7 @@ export interface UserConfig { /** * Array of vite plugins to use. */ - plugins?: (PluginOption | PluginOption[])[] + plugins?: PluginOption[] /** * Configure resolver */ @@ -199,7 +199,7 @@ export interface UserConfig { /** * Vite plugins that apply to worker bundle */ - plugins?: (PluginOption | PluginOption[])[] + plugins?: PluginOption[] /** * Rollup options to build worker bundle */ @@ -322,7 +322,7 @@ export async function resolveConfig( configEnv.mode = mode // resolve plugins - const rawUserPlugins = (config.plugins || []).flat().filter((p) => { + const rawUserPlugins = (config.plugins || []).flat(Infinity).filter((p) => { if (!p) { return false } else if (!p.apply) {