Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply condition skipped for nested plugins #7741

Merged
merged 1 commit into from Apr 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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