mirror of
				https://github.com/bartvdbraak/hellob.art.git
				synced 2025-10-30 19:59:10 +00:00 
			
		
		
		
	refactor: use @vercel/speed-insights for web vitals
This commit is contained in:
		
							parent
							
								
									09fc87af81
								
							
						
					
					
						commit
						8e37873b65
					
				
					 4 changed files with 12 additions and 123 deletions
				
			
		|  | @ -4,24 +4,8 @@ | |||
| 	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 | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit'; | ||||
| 	injectSpeedInsights(); | ||||
| 	export let data; | ||||
| </script> | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue