Skip to content

Commit 6c3d776

Browse files
committed
docs: Add more details to useLightningcss docs
1 parent 8d475c5 commit 6c3d776

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

docs/01-app/03-api-reference/05-config/01-next-config-js/useLightningcss.mdx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ description: Enable experimental support for Lightning CSS.
44
version: experimental
55
---
66

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.
812

913
```ts filename="next.config.ts" switcher
1014
import type { NextConfig } from 'next'
1115

1216
const nextConfig: NextConfig = {
1317
experimental: {
14-
useLightningcss: true,
18+
useLightningcss: false, // default, ignored on Turbopack
1519
},
1620
}
1721

@@ -22,9 +26,16 @@ export default nextConfig
2226
/** @type {import('next').NextConfig} */
2327
const nextConfig = {
2428
experimental: {
25-
useLightningcss: true,
29+
useLightningcss: true, // disables PostCSS on webpack
2630
},
2731
}
2832

2933
module.exports = nextConfig
3034
```
35+
36+
## Version History
37+
38+
| Version | Changes |
39+
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40+
| `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

Comments
 (0)