NextJS中文文档 - SassOptions
sassOptions
允许你配置 Sass 编译器。
ts
import type { NextConfig } from 'next'
const sassOptions = {
additionalData: `
$var: red;
`,
}
const nextConfig: NextConfig = {
sassOptions: {
...sassOptions,
implementation: 'sass-embedded',
},
}
export default nextConfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
js
/** @type {import('next').NextConfig} */
const sassOptions = {
additionalData: `
$var: red;
`,
}
const nextConfig = {
sassOptions: {
...sassOptions,
implementation: 'sass-embedded',
},
}
module.exports = nextConfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
须知: 除了
implementation
之外,sassOptions
没有类型定义,因为 Next.js 不维护其他可能的属性。