-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
35 lines (33 loc) · 798 Bytes
/
next.config.js
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
/** @type {import('next').NextConfig} */
const API = process.env.NEXT_PUBLIC_API
const path = require('path') // 1. path 선언
const nextConfig = {
reactStrictMode: false,
sassOptions: {
includePaths: [path.join(__dirname, 'styles')], // 2. sassOptions 옵션 추가
},
swcMinify: true,
compiler: {
styledComponents: true,
},
// next.js proxy
async rewrites() {
return [
{
source: '/@api/:path*',
destination: `${API}/:path*`,
},
]
},
// SVG import setting
webpack(config) {
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test && rule.test.test('.svg'))
fileLoaderRule.exclude = /\.svg$/
config.module.rules.push({
test: /\.svg$/,
loader: require.resolve('@svgr/webpack'),
})
return config
},
}
module.exports = nextConfig