diff --git a/packages/vitest/src/node/pool.ts b/packages/vitest/src/node/pool.ts index 6b0d6e07d9d0..fe90544eeec5 100644 --- a/packages/vitest/src/node/pool.ts +++ b/packages/vitest/src/node/pool.ts @@ -31,7 +31,7 @@ export function createPool(ctx: Vitest): WorkerPool { const maxThreads = ctx.config.maxThreads ?? threadsCount const minThreads = ctx.config.minThreads ?? threadsCount - const conditions = ctx.server.config.resolve.conditions?.flatMap(c => ['-C', c]) + const conditions = ctx.server.config.resolve.conditions?.flatMap(c => ['-C', c]) || [] const options: TinypoolOptions = { filename: workerPath, @@ -48,9 +48,9 @@ export function createPool(ctx: Vitest): WorkerPool { suppressLoaderWarningsPath, '--experimental-loader', loaderPath, - ...conditions || [], + ...conditions, ] - : [], + : conditions, } if (ctx.config.isolate) {