diff --git a/docs/config/index.md b/docs/config/index.md index 5fa28b36b..0ab8bdef7 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 bfbdf8617..d399217bc 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 = {