Skip to content

sassOptions

Source URL: https://nextjs.org/docs/app/api-reference/config/next-config-js/sassOptions

sassOptions allow you to configure the Sass compiler.

import type { NextConfig } from 'next'
const sassOptions = {
additionalData: `
$var: red;
`,
}
const nextConfig: NextConfig = {
sassOptions: {
...sassOptions,
implementation: 'sass-embedded',
},
}
export default nextConfig
/** @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.