Skip to content

Commit 9dba7ac

Browse files
committed
fix (deployment): next-pwa redudancy
1 parent de24f1c commit 9dba7ac

1 file changed

Lines changed: 0 additions & 60 deletions

File tree

src/client/next.config.js

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,6 @@
11
// src/client/next.config.js
22

33
/** @type {import('next').NextConfig} */
4-
import nextPWA from "next-pwa"
5-
6-
const withPWA = nextPWA({
7-
dest: "public",
8-
disable: process.env.NODE_ENV === "development",
9-
register: true,
10-
skipWaiting: true,
11-
exclude: [
12-
// add buildExcludes here
13-
({ asset, compilation }) => {
14-
if (
15-
asset.name.startsWith("server/") ||
16-
asset.name.match(
17-
/^((app-|^)build-manifest\.json|react-loadable-manifest\.json)$/
18-
)
19-
) {
20-
return true
21-
}
22-
if (
23-
process.env.NODE_ENV == "development" &&
24-
!asset.name.startsWith("static/runtime/")
25-
) {
26-
return true
27-
}
28-
return false
29-
}
30-
],
31-
runtimeCaching: [
32-
// Cache Google Fonts
33-
{
34-
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
35-
handler: "CacheFirst",
36-
options: {
37-
cacheName: "google-fonts-cache",
38-
expiration: {
39-
maxEntries: 10,
40-
maxAgeSeconds: 60 * 60 * 24 * 365 // 1 year
41-
},
42-
cacheableResponse: {
43-
statuses: [0, 200]
44-
}
45-
}
46-
},
47-
// Cache API data with a Stale-While-Revalidate strategy
48-
{
49-
urlPattern: /\/api\//, // Match any API route
50-
handler: "StaleWhileRevalidate",
51-
options: {
52-
cacheName: "api-data-cache",
53-
expiration: {
54-
maxEntries: 50,
55-
maxAgeSeconds: 60 * 60 // 1 hour
56-
},
57-
cacheableResponse: {
58-
statuses: [200]
59-
}
60-
}
61-
}
62-
]
63-
})
644

655
const nextConfig = {
666
images: {

0 commit comments

Comments
 (0)