mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
## What? Implements an error for the case where Turbopack is used with sassOptions.functions. Fixes #65241
50 lines
1.1 KiB
Plaintext
50 lines
1.1 KiB
Plaintext
---
|
|
title: sassOptions
|
|
description: Configure Sass options.
|
|
---
|
|
|
|
`sassOptions` allow you to configure the Sass compiler.
|
|
|
|
```ts filename="next.config.ts" switcher
|
|
import type { NextConfig } from 'next'
|
|
|
|
const sassOptions = {
|
|
additionalData: `
|
|
$var: red;
|
|
`,
|
|
}
|
|
|
|
const nextConfig: NextConfig = {
|
|
sassOptions: {
|
|
...sassOptions,
|
|
implementation: 'sass-embedded',
|
|
},
|
|
}
|
|
|
|
export default nextConfig
|
|
```
|
|
|
|
```js filename="next.config.js" switcher
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
const sassOptions = {
|
|
additionalData: `
|
|
$var: red;
|
|
`,
|
|
}
|
|
|
|
const nextConfig = {
|
|
sassOptions: {
|
|
...sassOptions,
|
|
implementation: 'sass-embedded',
|
|
},
|
|
}
|
|
|
|
module.exports = nextConfig
|
|
```
|
|
|
|
> **Good to know:**
|
|
>
|
|
> - `sassOptions` are not typed outside of `implementation` because Next.js does not maintain the other possible properties.
|
|
> - The `functions` property for defining custom Sass functions is only supported with webpack. When using Turbopack, custom Sass functions are not available because Turbopack's Rust-based architecture cannot directly execute JavaScript functions passed through this option.
|