This repository was archived by the owner on Oct 28, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
46 lines (44 loc) · 1.1 KB
/
next.config.js
File metadata and controls
46 lines (44 loc) · 1.1 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
const withOffline = require('next-offline');
const nextConfig = {
future: {
webpack5: true
},
poweredByHeader: false,
workboxOpts: {
runtimeCaching: [
{
urlPattern: /\.(?:html?)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'html'
}
},
{
urlPattern: /\.(?:css|js)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'assets'
}
},
{
urlPattern: /\.(?:json)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'json'
}
},
{
urlPattern: /\.(?:jpe?g|png|gif|webp|svg|ico)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'images'
}
}
],
// https://github.com/hanford/next-offline/issues/190#issuecomment-819499496
modifyURLPrefix: { 'autostatic/': '_next/static/' },
additionalManifestEntries: [{ url: 'index.html', revision: '2A99D780840F7DF0A8851084E8AAADBE' }]
}
};
module.exports = withOffline(nextConfig);
// module.exports = nextConfig;