Repository navigation
Expand file tree
/
Copy pathnext.config.js
More file actions
89 lines (87 loc) · 2.19 KB
/
Copy pathnext.config.js
File metadata and controls
89 lines (87 loc) · 2.19 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
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
const withPWA = require('next-pwa')({
dest: 'public',
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development',
runtimeCaching: [
{
urlPattern: /^https:\/\/www\.youtube\.com\/.*/,
handler: 'CacheFirst',
options: {
cacheName: 'youtube-cache',
expiration: {
maxEntries: 50,
maxAgeSeconds: 60 * 60 * 24 // 24 hours
}
}
},
{
// YouTube 썸네일 이미지 캐싱 (i.ytimg.com, i1~i9.ytimg.com)
urlPattern: /^https:\/\/i\d*\.ytimg\.com\/.*/,
handler: 'CacheFirst',
options: {
cacheName: 'youtube-thumbnail-cache',
expiration: {
maxEntries: 200,
maxAgeSeconds: 60 * 60 * 24 * 7 // 7 days
}
}
},
{
urlPattern: /^https:\/\/www\.googleapis\.com\/.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'youtube-api-cache',
expiration: {
maxEntries: 50,
maxAgeSeconds: 60 * 60 // 1 hour
}
}
}
]
})
/** @type {import('next').NextConfig} */
const nextConfig = {
allowedDevOrigins: ['127.0.0.1', 'localhost', '**.replit.dev', '**.repl.co'],
webpack: (config, { dev }) => {
if (dev) {
config.watchOptions = {
...config.watchOptions,
ignored: ['**/.local/**', '**/.git/**', '**/node_modules/**'],
}
}
return config
},
images: {
remotePatterns: [
{ protocol: 'https', hostname: 'assets.coingecko.com' },
{ protocol: 'https', hostname: 'coin-images.coingecko.com' },
// YouTube 썸네일 도메인 - i.ytimg.com, i1~i9.ytimg.com 모두 허용
{ protocol: 'https', hostname: '**.ytimg.com' },
// YouTube 채널 아이콘 도메인
{ protocol: 'https', hostname: 'yt3.ggpht.com' },
{ protocol: 'https', hostname: '**.ggpht.com' },
],
},
async headers() {
return []
},
async redirects() {
return [
{
source: '/',
destination: '/money-tracker',
permanent: false,
},
]
},
async rewrites() {
return [
{
source: '/stablecoin',
destination: '/stablecoins'
}
]
}
}
module.exports = withPWA(nextConfig)