forked from shopstr-eng/shopstr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
85 lines (81 loc) · 2.17 KB
/
next.config.mjs
File metadata and controls
85 lines (81 loc) · 2.17 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
/** @type {import('next').NextConfig} */
import withPWAInit from "@ducanh2912/next-pwa";
const withPWA = withPWAInit({
dest: "public",
register: true,
skipWaiting: true,
sw: "service-worker.js",
disable: process.env.NODE_ENV === "development",
runtimeCaching: [
{
urlPattern: /^https:\/\/.*\.(png|jpg|jpeg|svg|gif|ico|css|js)$/,
handler: "CacheFirst",
options: {
cacheName: "static-assets",
expiration: {
maxEntries: 200,
maxAgeSeconds: 7 * 24 * 60 * 60,
},
},
},
{
urlPattern: /^https:\/\/.*\/api\/.*/,
handler: "NetworkFirst",
options: {
cacheName: "api-cache",
networkTimeoutSeconds: 10,
expiration: {
maxEntries: 50,
maxAgeSeconds: 24 * 60 * 60,
},
},
},
{
urlPattern: /^https?.*/,
handler: "NetworkFirst",
options: {
cacheName: "general-cache",
networkTimeoutSeconds: 15,
expiration: {
maxEntries: 100,
maxAgeSeconds: 7 * 24 * 60 * 60,
},
},
},
],
});
const nextConfig = {
bundlePagesRouterDependencies: true,
output: "standalone",
reactStrictMode: true,
poweredByHeader: false,
turbopack: {},
async rewrites() {
return [
{
source: "/sitemap.xml",
destination: "/api/sitemap.xml",
},
{
source: "/robots.txt",
destination: "/api/robots.txt",
},
];
},
images: {
remotePatterns: [
{ protocol: "https", hostname: "www.google.com" },
{ protocol: "https", hostname: "www.facebook.com" },
{ protocol: "https", hostname: "www.twitter.com" },
{ protocol: "https", hostname: "www.instagram.com" },
{ protocol: "https", hostname: "duckduckgo.com" },
{ protocol: "https", hostname: "www.youtube.com" },
{ protocol: "https", hostname: "www.pinterest.com" },
{ protocol: "https", hostname: "www.linkedin.com" },
{ protocol: "https", hostname: "www.reddit.com" },
{ protocol: "https", hostname: "www.quora.com" },
{ protocol: "https", hostname: "www.wikipedia.org" },
],
},
};
export default withPWA(nextConfig);