diff --git a/next.config.js b/next.config.js index b76e73e..ffa0116 100644 --- a/next.config.js +++ b/next.config.js @@ -3,9 +3,9 @@ const { withSentryConfig } = require('@sentry/nextjs') const withPWA = require('next-pwa') const VERSION = require('./package.json').version -module.exports = withSentryConfig(withPWA({ +const NextConfig = { pwa: { - dest: 'public' + register: false }, env: { NEXT_PUBLIC_RELEASE_VERSION: VERSION, @@ -17,4 +17,5 @@ module.exports = withSentryConfig(withPWA({ experimental: { scrollRestoration: true } -}), {}) \ No newline at end of file +} +module.exports = withSentryConfig(withPWA(NextConfig)) \ No newline at end of file diff --git a/pages/_app.tsx b/pages/_app.tsx index 87ef62c..ce87006 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -8,7 +8,7 @@ import NProgress from 'nprogress' import Logger from '@utils/Logger' import { handlePWA, parseCookie, systemTheme } from '@utils/Tools' -import { shortcutKeyMap } from '@utils/Constants' +import { shortcutKeyMap, TITLE } from '@utils/Constants' import { Theme } from '@types' const Footer = dynamic(() => import('@components/Footer')) @@ -52,12 +52,16 @@ const KoreanbotsApp = ({ Component, pageProps, err, cookie }: KoreanbotsProps): } else setTheme(localStorage.theme) setStandalone(handlePWA()) + + if('serviceWorker' in navigator) { + navigator.serviceWorker.register("/sw.js") + } else Logger.warn('[SW] Load Failed') }, []) return
- 한국 디스코드봇 리스트 + {TITLE}
diff --git a/pages/_document.tsx b/pages/_document.tsx index d924aba..666a4a8 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,3 +1,4 @@ +import { DESCRIPTION, THEME_COLOR, TITLE } from '@utils/Constants' import Document, { DocumentContext, Html, Head, Main, NextScript } from 'next/document' class MyDocument extends Document { @@ -8,21 +9,62 @@ class MyDocument extends Document { } render() { return ( - + + {/* META */} - - + + + - + - + + {/* Android */} + + + + {/* iOS */} + + + + + {/* Windows */} + + + + + + {/* Pinned Sites */} + + + + + {/* Tap highlighting */} + + + {/* UC Mobile Browser */} + + + + + + + + + {/* LINK */} + + - + + + + + {/* iOS */} @@ -32,14 +74,17 @@ class MyDocument extends Document { + + + + + {/* Android */} - - - - - - - + + {/* Others */} + + + {/* SCRIPT */}