From e1bd8d5dc956c0db2fc1642f9f6d4bd398cffc14 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 12 Feb 2024 11:40:45 +0100 Subject: [PATCH] fix(vitest): disable optimizer by default until it's stable (#5156) --- docs/config/index.md | 2 +- packages/vitest/src/node/plugins/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/config/index.md b/docs/config/index.md index 5fa28b36bde6..0ab8bdef7493 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -159,7 +159,7 @@ You will not be able to edit your `node_modules` code for debugging, since the c #### deps.optimizer.{mode}.enabled - **Type:** `boolean` -- **Default:** `true` if using >= Vite 4.3.2, `false` otherwise +- **Default:** `false` since Vitest 1.3.0 Enable dependency optimization. diff --git a/packages/vitest/src/node/plugins/utils.ts b/packages/vitest/src/node/plugins/utils.ts index bfbdf8617a8f..d399217bc955 100644 --- a/packages/vitest/src/node/plugins/utils.ts +++ b/packages/vitest/src/node/plugins/utils.ts @@ -14,7 +14,7 @@ export function resolveOptimizerConfig(_testOptions: DepsOptimizationOptions | u console.warn(`Vitest: "deps.optimizer" is only available in Vite >= 4.3.2, current Vite version: ${viteVersion}`) else // enable by default - testOptions.enabled ??= true + testOptions.enabled ??= false if (!allowed || testOptions?.enabled !== true) { newConfig.cacheDir = undefined newConfig.optimizeDeps = {