mirror of
				https://github.com/bartvdbraak/hellob.art.git
				synced 2025-10-30 19:59:10 +00:00 
			
		
		
		
	feat: implement @vercel/analytics and web-vitals dependencies
This commit is contained in:
		
							parent
							
								
									7d70f2d2ed
								
							
						
					
					
						commit
						2f6387df2c
					
				
					 4 changed files with 122 additions and 1 deletions
				
			
		|  | @ -4,6 +4,23 @@ | |||
| 	import '../styles/globals.css'; | ||||
| 	import { ModeWatcher } from 'mode-watcher'; | ||||
| 	import { fly } from 'svelte/transition'; | ||||
| 	import { inject } from '@vercel/analytics'; | ||||
| 	import { webVitals } from '$lib/vitals'; | ||||
| 	import { browser } from '$app/environment'; | ||||
| 	import { page } from '$app/stores'; | ||||
| 
 | ||||
| 	inject({ mode: dev ? 'development' : 'production' }); | ||||
| 
 | ||||
| 	let analyticsId = import.meta.env.VERCEL_ANALYTICS_ID; | ||||
| 
 | ||||
| 	$: if (browser && analyticsId) { | ||||
| 		webVitals({ | ||||
| 			path: $page.url.pathname, | ||||
| 			params: $page.params, | ||||
| 			analyticsId, | ||||
| 			debug: false | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	export let data; | ||||
| </script> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue