Skip to content

Commit 167b5e7

Browse files
committed
add pwa
1 parent 276867b commit 167b5e7

10 files changed

Lines changed: 1899 additions & 14969 deletions

File tree

frontend/main/.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ yarn-error.log*
3535
*.env
3636

3737
public/robots.txt
38-
public/sitemap.xml
38+
public/sitemap.xml
39+
40+
# PWA files
41+
**/public/sw.js
42+
**/public/workbox-*.js
43+
**/public/worker-*.js
44+
**/public/sw.js.map
45+
**/public/workbox-*.js.map
46+
**/public/worker-*.js.map

frontend/main/next.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
44
enabled: process.env.ANALYZE === 'true',
55
});
66

7-
module.exports = withBundleAnalyzer({
7+
const withPWA = require("next-pwa");
8+
9+
10+
module.exports = withPWA(withBundleAnalyzer({
811
reactStrictMode: true,
912
images: {
1013
loader: 'cloudinary',
@@ -34,4 +37,10 @@ module.exports = withBundleAnalyzer({
3437
},
3538
];
3639
},
37-
});
40+
pwa: {
41+
dest: "public",
42+
register: true,
43+
skipWaiting: true,
44+
disable: process.env.NODE_ENV === "development",
45+
},
46+
}));

0 commit comments

Comments
 (0)