new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Vite · Config reference · all subjects

build options: css

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

css.preprocessorMaxWorkers type and default

The css.preprocessorMaxWorkers option is of type number or true with a default value of true. It specifies the maximum number of threads CSS preprocessors can use. true means up to the number of CPUs minus 1. When set to 0, Vite will not create any workers and will run the preprocessors in the main thread.

css.modules option type

The css.modules option is of type CSSModulesOptions. It configures CSS modules behavior with options like getJSON, scopeBehaviour, globalModulePaths, exportGlobals, generateScopedName, hashPrefix, and localsConvention. The options are passed on to postcss-modules.

css.postcss option type

The css.postcss option is of type string or (postcss.ProcessOptions & { plugins?: postcss.AcceptedPlugin[] }). It specifies inline PostCSS config or a custom directory to search PostCSS config from, defaulting to project root. For inline config, only array format can be used for the plugins property.

css.preprocessorOptions option type

The css.preprocessorOptions option is of type Record<string, object>. It specifies options to pass to CSS pre-processors, with file extensions used as keys. Supported preprocessors include sass/scss, less, and styl/stylus.

css.preprocessorOptions additionalData type

The css.preprocessorOptions[extension].additionalData option is of type string or ((source: string, filename: string) => (string | { content: string; map?: SourceMap })). It injects extra code for each style content.

css.devSourcemap option type and default

The css.devSourcemap option is of type boolean with a default value of false. It controls whether to enable sourcemaps during dev.

css.transformer option type and default

The css.transformer option is of type 'postcss' or 'lightningcss' with a default value of 'postcss'. It selects the engine used for CSS processing.

css.lightningcss option type

The css.lightningcss option configures Lightning CSS with properties like targets, include, exclude, drafts, nonStandard, pseudoClasses, unusedSymbols, and cssModules. Full transform options can be found in the Lightning CSS repo.

Give your agent this brain