-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
52 lines (48 loc) · 1.31 KB
/
next.config.ts
File metadata and controls
52 lines (48 loc) · 1.31 KB
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
import type { NextConfig } from "next";
const isProduction = process.env.NODE_ENV === "production";
export const isStrictMode = true;
const nextConfig: NextConfig = {
reactStrictMode: isStrictMode,
// Configure `pageExtensions` to include markdown and MDX files
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
// Optionally, add any other Next.js config below
/* config options here */
webpack: (config) => {
// svg 파일을 위한 svgr 웹팩 추가
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ["@svgr/webpack"],
});
return config;
},
// 빌드 시 콘솔 제거
compiler: {
removeConsole: isProduction,
},
// 외부 이미지 호스트 허용 설정
images: {
domains: ["mos-data-bucket.s3.amazonaws.com", "ui-avatars.com"],
remotePatterns: [
{
protocol: 'https',
hostname: 'via.placeholder.com',
port: '',
pathname: '/**',
},
],
},
// 개발 환경에서 WebSocket 프록시 설정(http, https 요청)
async rewrites() {
if (process.env.NODE_ENV === "development") {
return [
{
source: "/ws-stomp/:path*",
destination: "http://localhost:8080/ws-stomp/:path*",
},
];
}
return [];
},
};
export default nextConfig;