Very minor optimization options
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
<script>
|
||||
import '../app.css';
|
||||
import { dev } from '$app/environment';
|
||||
import { inject } from '@vercel/analytics';
|
||||
import { onMount } from 'svelte';
|
||||
import Navbar from 'components/layout/NavBar.svelte';
|
||||
import Footer from 'components/layout/Footer.svelte';
|
||||
|
||||
inject({ mode: dev ? 'development' : 'production' });
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
// Lazy load analytics only in production for faster dev startup
|
||||
onMount(async () => {
|
||||
if (!dev) {
|
||||
const { inject } = await import('@vercel/analytics');
|
||||
inject({ mode: 'production' });
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Navbar />
|
||||
|
||||
Reference in New Issue
Block a user