Skip to content

Commit

Permalink
only load vercel analytics on production
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSunshyne committed Aug 8, 2023
1 parent 785317b commit b02cdb5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/BaseHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ const {
document.addEventListener("astro:beforeload", setDarkMode);
</script>

<VercelAnalytics />
{
import.meta.env.MODE === "production" && (
<>
<VercelAnalytics />
<script is:inline defer src="/_vercel/insights/script.js" />
</>
)
}

<script is:inline defer src="/_vercel/insights/script.js"></script>
<!-- <script>
import '../utils//navigation.js'
</script> -->
Expand Down

0 comments on commit b02cdb5

Please sign in to comment.