Skip to content

Commit

Permalink
Update analytics script to use rewrites
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinsjoy committed Dec 11, 2024
1 parent 6fe389c commit 1cbef7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/(root)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function RootLayout({
<Toaster />
<script
defer
src="https://cloud.umami.is/script.js"
src="/analytics.js"
data-website-id="fc9e67af-05d7-4851-a66e-e07b2a3bb30c"
></script>
<Analytics />
Expand Down
8 changes: 8 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ const nextConfig = {
},
],
},
async rewrites() {
return [
{
source: '/analytics.js',
destination: 'https://cloud.umami.is/script.js',
},
];
},
};

export default nextConfig;

0 comments on commit 1cbef7f

Please sign in to comment.