-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
63 lines (60 loc) · 1.23 KB
/
next.config.js
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
const nextPWA = require('next-pwa')
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true
},
async headers() {
return [
{
headers: [
{
key: 'cache-control',
value: 'max-age=600, s-maxage=60'
}
],
source: '/((?!_next).*)'
},
{
headers: [
{
key: 'cache-control',
value: 'max-age=0'
}
],
source: '/service-worker.js'
},
{
headers: [
{
key: 'cache-control',
value: 'immutable, max-age=31536000'
}
],
source: '/workbox-:hash.js'
}
]
},
async rewrites() {
return [
{
destination: '/_next/static/service-worker.js',
source: '/service-worker.js'
},
{
destination: '/_next/static/workbox-:hash.js',
source: '/workbox-:hash.js'
},
{
destination: '/manifest.webmanifest',
source: '/manifest.json'
}
]
}
}
const withPWA = nextPWA({
dest: '.next/static',
disable: process.env.NODE_ENV === 'development',
sw: 'service-worker.js'
})
module.exports = withPWA(nextConfig)