How do I detect whether a script was loaded from +page.server.js or +page.svelte?
+page.server.js
+page.svelte
Is there a (Svelte) function that I can import to see the difference?
There is a browser flag you can check:
browser
import { browser } from '$app/environment';