Skip to content

Commit

Permalink
fix: exclude vite-plugin-checker from runtime vitest config
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 5, 2023
1 parent 5b18911 commit 053a5df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ async function startNuxtAndGetViteConfig(
return promise
}

const excludedPlugins = [
'nuxt:import-protection',
'vite-plugin-checker',
]

export async function getVitestConfigFromNuxt(
options?: GetVitestConfigOptions,
overrides?: NuxtConfig
Expand All @@ -67,10 +72,7 @@ export async function getVitestConfigFromNuxt(
})
}

options.viteConfig.plugins ||= []
options.viteConfig.plugins = options.viteConfig.plugins?.filter(
p => (p as any)?.name !== 'nuxt:import-protection'
)
options.viteConfig.plugins = (options.viteConfig.plugins || []).filter(p => !excludedPlugins.includes((p as any)?.name))

const resolvedConfig = defu(
// overrides
Expand Down

0 comments on commit 053a5df

Please sign in to comment.