> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# tools.lightningcssLoader

- **Type:** `Rspack.LightningcssLoaderOptions | Function | boolean`
- **Default:** `Rspack.LightningcssLoaderOptions | Function | boolean`

You can configure [builtin:lightningcss-loader](https://rspack.rs/guide/features/builtin-lightningcss-loader) through `tools.lightningcssLoader`.

## Enable loader

Set `tools.lightningcssLoader` to `true` to enable Rsbuild's built-in `lightningcss-loader`:

```js
export default {
  tools: {
    lightningcssLoader: true,
  },
};
```

At this time, the default configuration is as follows:

```js
const defaultOptions = {
  // use current browserslist config
  targets: browserslist,
  // minify is enabled when output.injectStyles is true and in production mode
  minify: config.mode === 'production' && config.output.injectStyles,
};
```

It should be noted that when `lightningcss-loader` is turned on, `postcss-loader` will be turned off by default.

:::info
The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to [Rsbuild - tools.lightningcssLoader](https://v2.rsbuild.dev/config/tools/lightningcss-loader).
:::