-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.ts
142 lines (129 loc) · 3.18 KB
/
next.config.ts
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import { NextConfig } from 'next';
import createNextIntlPlugin from 'next-intl/plugin';
const nextConfig: NextConfig = {
reactStrictMode: true,
experimental: {
serverActions: {
// 게시물 작성시 첨부파일 지원 목적
bodySizeLimit: '10mb',
// https://github.com/vercel/next.js/issues/58295
allowedOrigins: [
'csereal-prod.bacchus.io:443',
'csereal-prod.bacchus.io',
'cse.snu.ac.kr',
'cse.snu.ac.kr:443',
'id.snucse.org',
],
},
},
// react-svgr 설정
// https://react-svgr.com/docs/next/
webpack(config) {
// Grab the existing rule that handles SVG imports
// @ts-expect-error webpack 관련 설정인데 타입을 모르겠음
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'));
config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
type: 'asset',
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
resourceQuery: { not: /url/ }, // exclude if *.svg?url
use: ['@svgr/webpack'],
},
{
test: /\.(mov|mp4)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
},
},
],
},
);
// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;
return config;
},
images: {
remotePatterns: [
// 테스트용 이미지 관련
{
protocol: 'https',
hostname: 'picsum.photos',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cse.snu.ac.kr',
pathname: '/**',
},
{
protocol: 'http',
hostname: 'cse-dev-waffle.bacchus.io',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cse-dev-waffle.bacchus.io',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'csereal-prod.bacchus.io',
pathname: '/**',
},
{
protocol: 'http',
hostname: 'localhost',
pathname: '/**',
port: '8080',
},
],
},
async redirects() {
return [
{
source: '/login/success',
destination: '/',
permanent: false,
},
{
source: '/logout/success',
destination: '/',
permanent: false,
},
];
},
async headers() {
return [
{
source: '/(.*)?', // 모든 페이지
headers: [
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
],
},
];
},
poweredByHeader: false,
};
const withNextIntl = createNextIntlPlugin();
export default withNextIntl(nextConfig);