Skip to content

Commit

Permalink
only render script on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Oct 22, 2024
1 parent 0c75025 commit ffd806f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ARG NEXT_PUBLIC_CONVEX_URL

ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
ENV NEXT_PUBLIC_ENABLE_UNAMI=true

RUN npm run build

Expand Down
10 changes: 7 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ export default function RootLayout({
}>) {
return (
<ConvexAuthNextjsServerProvider>
<Script defer src="https://umami-production-101d.up.railway.app/script.js"
data-website-id="6e6265bb-25ed-4f8b-819b-44a27434ed51"
></Script>
{process.env.NEXT_PUBLIC_ENABLE_UNAMI === "true" && (
<Script
defer
src="https://umami-production-101d.up.railway.app/script.js"
data-website-id="6e6265bb-25ed-4f8b-819b-44a27434ed51"
/>
)}
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<Providers>
Expand Down

0 comments on commit ffd806f

Please sign in to comment.