diff --git a/docs/config/shared-options.md b/docs/config/shared-options.md index 592818c13c0126..7742c47b0b83da 100644 --- a/docs/config/shared-options.md +++ b/docs/config/shared-options.md @@ -280,11 +280,12 @@ export default defineConfig({ ## css.preprocessorMaxWorkers -- **Experimental:** [Give Feedback](https://github.com/vitejs/vite/discussions/15835) - **Type:** `number | true` -- **Default:** `0` (does not create any workers and run in the main thread) +- **Default:** `true` + +Specifies how many threads CSS preprocessors will run on. `true` means the number of CPUs minus 1. When set to `0`, Vite will not create any workers and run the preprocessors in the main thread. -If this option is set, CSS preprocessors will run in workers when possible. `true` means the number of CPUs minus 1. +Depending on the preprocessor options, Vite may run the preprocessors on the main thread even if this option is not set to `0`. ## css.devSourcemap diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index f3c4d1ec512775..75146c2c3f1459 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -144,8 +144,7 @@ export interface CSSOptions { * If this option is set, preprocessors will run in workers when possible. * `true` means the number of CPUs minus 1. * - * @default 0 - * @experimental + * @default true */ preprocessorMaxWorkers?: number | true postcss?: @@ -199,8 +198,7 @@ export const cssConfigDefaults = Object.freeze({ transformer: 'postcss', // modules // preprocessorOptions - /** @experimental */ - preprocessorMaxWorkers: 0, + preprocessorMaxWorkers: true, // postcss /** @experimental */ devSourcemap: false,