From 053a5dffe634cbfa8bea72b4627c977d50b3d7c7 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 5 Dec 2023 14:48:01 +0000 Subject: [PATCH] fix: exclude `vite-plugin-checker` from runtime vitest config --- src/config.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/config.ts b/src/config.ts index 9dac05970..77b24334a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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 @@ -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