-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
55 lines (52 loc) · 1.21 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
/** @type {import('next').NextConfig} */
import withPWAInit from '@ducanh2912/next-pwa';
const withPWA = withPWAInit({
dest: 'public',
skipWaiting: true,
workboxOptions: {
runtimeCaching: [
{
urlPattern:
/^https:\/\/gymmi\.s3\.ap-northeast-2\.amazonaws\.com\/.*\.(png|jpg|jpeg|svg|gif|webp|avif)(\?.*)?$/,
handler: 'CacheFirst',
options: {
cacheName: 'image-cache',
expiration: {
maxEntries: 50,
maxAgeSeconds: 30 * 24 * 60 * 60, // 30일
},
cacheableResponse: {
statuses: [0, 200], // 성공적인 응답만 캐시
},
matchOptions: {
ignoreSearch: true, // URL 파라미터 무시
},
},
},
],
cleanupOutdatedCaches: true, // 오래된 캐시 자동 정리
},
});
const nextConfig = {
// api: {
// bodyParser: false,
// },
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
},
async rewrites() {
return [
{
source: '/',
destination: '/home',
},
];
},
};
export default withPWA(nextConfig);