Skip to content

Commit eb1ba01

Browse files
committed
docs: document vite.css.preprocessorMaxWorkers
resolves #26539
1 parent 17261e6 commit eb1ba01

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/1.getting-started/4.styling.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,27 @@ export default defineNuxtConfig({
258258

259259
Nuxt uses Vite by default. If you wish to use webpack instead, refer to each preprocessor loader [documentation](https://webpack.js.org/loaders/sass-loader).
260260

261+
### Preprocessor Workers (Experimental)
262+
263+
Vite has made available an [experimental option](https://vite.dev/config/shared-options.html#css-preprocessormaxworkers) which can speed up using preprocessors.
264+
265+
You can enable this in your `nuxt.config`:
266+
267+
```ts
268+
269+
export default defineNuxtConfig({
270+
vite: {
271+
css: {
272+
preprocessorMaxWorkers: true // number of CPUs minus 1
273+
}
274+
}
275+
})
276+
```
277+
278+
::note
279+
This is an experimental option and you should refer to the Vite documentation and [provide feedback](https://github.com/vitejs/vite/discussions/15835).
280+
::
281+
261282
## Single File Components (SFC) Styling
262283

263284
One of the best things about Vue and SFC is how great it is at naturally dealing with styling. You can directly write CSS or preprocessor code in the style block of your components file, therefore you will have fantastic developer experience without having to use something like CSS-in-JS. However if you wish to use CSS-in-JS, you can find 3rd party libraries and modules that support it, such as [pinceau](https://github.com/Tahul/pinceau).

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy