fix: do not load socketio for next dev

This commit is contained in:
Timothy Lin
2021-11-19 00:12:26 +08:00
parent 40adee4707
commit 55cbecfe3a
2 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import LayoutWrapper from '@/components/LayoutWrapper'
import { ClientReload } from '@/components/ClientReload'
const isDevelopment = process.env.NODE_ENV === 'development'
const isSocket = process.env.SOCKET
export default function App({ Component, pageProps }) {
return (
@ -16,7 +17,7 @@ export default function App({ Component, pageProps }) {
<Head>
<meta content="width=device-width, initial-scale=1" name="viewport" />
</Head>
{isDevelopment && <ClientReload />}
{isDevelopment && isSocket && <ClientReload />}
<Analytics />
<LayoutWrapper>
<Component {...pageProps} />