chore: update client check for smaller bundle size (#12975)

pull/12978/head
Ben McCann 4 months ago committed by GitHub
parent b579c5c06c
commit 448f21620f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
chore: update client check for smaller bundle size

@ -1,11 +1,11 @@
/** @import { Raf } from '#client' */
import { noop } from '../shared/utils.js';
const is_client = typeof window !== 'undefined';
import { BROWSER } from 'esm-env';
const request_animation_frame = is_client ? requestAnimationFrame : noop;
const request_animation_frame = BROWSER ? requestAnimationFrame : noop;
const now = is_client ? () => performance.now() : () => Date.now();
const now = BROWSER ? () => performance.now() : () => Date.now();
/** @type {Raf} */
export const raf = {

Loading…
Cancel
Save