From 9c13df19a6ffe0dbfa291404cdfa72c8633b7200 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Fri, 25 Oct 2024 11:15:21 +0700 Subject: add pwa library --- next.config.mjs | 9 ++++++++- package.json | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/next.config.mjs b/next.config.mjs index 4678774..ab509d0 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,11 @@ +import withPWA from 'next-pwa'; + /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = withPWA({ + dest: 'public', + register: true, + disable: process.env.NODE_ENV === 'development', + skipWaiting: true +}); export default nextConfig; diff --git a/package.json b/package.json index 387fecb..45abfe7 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "axios": "^1.7.7", "cookies-next": "^4.3.0", "next": "14.2.15", + "next-pwa": "^5.6.0", "opencv.js": "^1.2.1", "quagga": "^0.12.1", "react": "^18", -- cgit v1.2.3