Skip to content

Commit

Permalink
Only include client side
Browse files Browse the repository at this point in the history
  • Loading branch information
carlreid committed Feb 4, 2021
1 parent 9a77ea3 commit 786476c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const withTM = require('next-transpile-modules')(['@babylonjs/core', '@babylonjs/gui', 'react-babylonjs'])
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
Expand Down Expand Up @@ -28,4 +27,4 @@ const nextConfig = {
}
}

module.exports = withPlugins([withBundleAnalyzer, withTM], nextConfig)
module.exports = withPlugins([withBundleAnalyzer], nextConfig)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Dominic Rubas <dominic.rubas@seriously.ch>",
"scripts": {
"build": "ANALYZE=true next build",
"dev": "NODE_OPTIONS=--max_old_space_size=4096 next dev",
"dev": "next dev",
"format": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc",
"lint": "eslint --fix .",
"start": "next start"
Expand Down
7 changes: 5 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import 'twin.macro'

import dynamic from 'next/dynamic'
import Head from 'next/head'

import Wave from '../components/elements/Wave/Wave'
const WaveDynamic = dynamic(() => import('../components/elements/Wave/Wave'), {
ssr: false
})

export default function Home(): JSX.Element {
return (
Expand All @@ -15,7 +18,7 @@ export default function Home(): JSX.Element {
<main>
<h1 tw="bg-gray-100 rounded-xl p-8">Wave</h1>

<Wave />
<WaveDynamic />
</main>
</div>
)
Expand Down

0 comments on commit 786476c

Please sign in to comment.