chore(pwa): config workbox to skip precaching next.js internal files (#2478)

This commit is contained in:
Huang Xin
2025-11-19 19:08:04 +05:30
committed by GitHub
parent eb6fa276de
commit f881caf794
+19 -1
View File
@@ -66,7 +66,8 @@ const nextConfig = {
const withPWA = withPWAInit({
dest: 'public',
disable: isDev || appPlatform !== 'web',
buildExcludes: [/\/_headers$/],
cacheStartUrl: false,
dynamicStartUrl: false,
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
@@ -76,6 +77,23 @@ const withPWA = withPWAInit({
},
workboxOptions: {
disableDevLogs: true,
manifestTransforms: [
(manifestEntries) => {
const manifest = manifestEntries.filter((entry) => {
const url = entry.url;
return (
!url.includes('dynamic-css-manifest.json') &&
!url.includes('middleware-manifest.json') &&
!url.includes('react-loadable-manifest.json') &&
!url.includes('build-manifest.json') &&
!url.includes('_buildManifest.js') &&
!url.includes('_ssgManifest.js') &&
!url.includes('_headers')
);
});
return { manifest };
},
],
},
});