Skip to content

Commit

Permalink
fix: apply condition skipped for nested plugins (#7741)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Apr 15, 2022
1 parent 434bb5c commit 1f2ca53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vite/src/node/config.ts
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -109,7 +109,7 @@ export interface UserConfig {
/**
* Array of vite plugins to use.
*/
plugins?: (PluginOption | PluginOption[])[]
plugins?: PluginOption[]
/**
* Configure resolver
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1f2ca53

Please sign in to comment.