-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
71 lines (68 loc) · 1.7 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
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
import withPWAInit from "@ducanh2912/next-pwa"
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
})
return config
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
{
protocol: "http",
hostname: "*.kakaocdn.net",
pathname: "/**",
},
],
},
// SharedArrayBuffer를 사용하려면 Cross-Origin-Embedder-Policy 헤더를 require-corp로 설정해야 합니다.
// @ffmpeg/ffmpeg 모듈을 사용할 때 SharedArrayBuffer를 사용하므로 설정합니다.
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Cross-Origin-Embedder-Policy",
value: "require-corp",
},
{
key: "Cross-Origin-Opener-Policy",
value: "same-origin",
},
],
},
]
},
async rewrites() {
return {
beforeFiles: [
{
source: "/blog",
destination: "https://inblog.ai/mafoo",
},
{
source: "/blog/:path*",
destination: "https://inblog.ai/mafoo/:path*",
},
{
source: "/robots.txt",
destination: "https://inblog.ai/mafoo/robots.txt",
},
{
source: "/_inblog/:path*",
destination: "https://inblog.ai/mafoo/_inblog/:path*",
},
],
};
},
}
const isProd = process.env.NODE_ENV === "production" // 빌드 환경에서만 PWA를 적용합니다.
const config = isProd ? withPWAInit({ dest: "public" })(nextConfig) : nextConfig
export default config