-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
40 lines (39 loc) · 1.16 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const withPWA = require("@ducanh2912/next-pwa").default({
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
swcMinify: true,
disable: process.env.NODE_ENV === "development",
dest: "public",
// fallbacks: {
// image: "/static/images/fallback.png",
// document: "/fallback", // if you want to fallback to a custom page rather than /_offline
// font: '/static/font/fallback.woff2',
// audio: ...,
// video: ...,
// },
workboxOptions: {
disableDevLogs: true,
},
extendDefaultRuntimeCaching: (defaultRuntimeCaching) => {
// Add a new caching strategy for a specific URL pattern
defaultRuntimeCaching.push({
urlPattern: /^https?.*/,
handler: "CacheFirst",
options: {
cacheName: "api-data-cache",
expiration: {
maxEntries: 200,
maxAgeSeconds: 60 * 60 * 24 * 30, // 30 days
},
},
});
},
// ... other options you like
});
/** @type {import('next').NextConfig} */
const nextConfig = {
// ... other options you like
};
module.exports = withPWA(nextConfig);