-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
44 lines (41 loc) · 1.16 KB
/
next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const varFileName = "_vars.sass"
const rootFileName = "root.sass"
const keyframesFileName = "_keyframes.sass"
const importVars = `@use "~@s/${varFileName}" as v`
const importKeyframes = `@use "~@s/${keyframesFileName}" as k`
const importAll = `
${importVars}
${importKeyframes}
`
/**
* @type {import('next').NextConfig}
*/
const nextConfig = (_phase, { defaultConfig }) => ({
images: {
remotePatterns: [
{
protocol: "https",
hostname: "media.graphassets.com",
},
],
},
typescript: {
ignoreBuildErrors: true,
},
sassOptions: {
...defaultConfig.sassOptions,
additionalData: (content, context) => {
const resourcePathParts = context.resource.split("/")
const sheetPath = resourcePathParts[resourcePathParts.length - 1];
const isVariables = sheetPath.includes(varFileName)
const isKeyFrames = sheetPath.includes(keyframesFileName)
const isRoot = sheetPath.includes(rootFileName)
if (isVariables) {
return content
}
if (isRoot || isKeyFrames) return [importVars, content].join("\n");
return [importAll, content].join("\n");
}
}
});
export default nextConfig;