You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/01-app/03-api-reference/05-config/01-next-config-js/useLightningcss.mdx
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,18 @@ description: Enable experimental support for Lightning CSS.
4
4
version: experimental
5
5
---
6
6
7
-
Experimental support for using [Lightning CSS](https://lightningcss.dev), a fast CSS bundler and minifier, written in Rust.
7
+
Experimental support for using [Lightning CSS](https://lightningcss.dev) with webpack. Lightning CSS is a fast CSS transformer and minifier, written in Rust.
8
+
9
+
If this option is not set, Next.js on webpack uses [PostCSS](https://postcss.org/) with [`postcss-preset-env`](https://www.npmjs.com/package/postcss-preset-env) by default.
10
+
11
+
Turbopack uses Lightning CSS by default since Next 14.2. This configuration option has no effect on Turbopack. Turbopack always uses Lightning CSS.
8
12
9
13
```ts filename="next.config.ts" switcher
10
14
importtype { NextConfig } from'next'
11
15
12
16
const nextConfig:NextConfig= {
13
17
experimental: {
14
-
useLightningcss: true,
18
+
useLightningcss: false, // default, ignored on Turbopack
15
19
},
16
20
}
17
21
@@ -22,9 +26,16 @@ export default nextConfig
22
26
/**@type{import('next').NextConfig}*/
23
27
constnextConfig= {
24
28
experimental: {
25
-
useLightningcss:true,
29
+
useLightningcss:true,// disables PostCSS on webpack
|`15.1.0`| Support for `useSwcCss` was removed from Turbopack. |
41
+
|`14.2.0`| Turbopack's default CSS processor was changed from `@swc/css` to Lightning CSS. `useLightningcss` became ignored on Turbopack, and a legacy `experimental.turbo.useSwcCss` option was added. |
0 commit comments