Skip to content

sassOptions

sassOptions 允许你配置 Sass 编译器。

¥sassOptions allow you to configure the Sass compiler.

ts
import type { NextConfig } from 'next'

const sassOptions = {
  additionalData: `
    $var: red;
  `,
}

const nextConfig: NextConfig = {
  sassOptions: {
    ...sassOptions,
    implementation: 'sass-embedded',
  },
}

export default nextConfig
js
/** @type {import('next').NextConfig} */

const sassOptions = {
  additionalData: `
    $var: red;
  `,
}

const nextConfig = {
  sassOptions: {
    ...sassOptions,
    implementation: 'sass-embedded',
  },
}

module.exports = nextConfig

需要了解:sassOptions 不在 implementation 之外输入,因为 Next.js 不维护其他可能的属性。

¥Good to know: sassOptions are not typed outside of implementation because Next.js does not maintain the other possible properties.

Next.js v15.3 中文网 - 粤ICP备13048890号