File size: 489 Bytes
8d3471e
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export function detectRuntimeEnv() {
    const deployTarget = String(import.meta.env.VITE_DEPLOY_TARGET || '').trim().toLowerCase()
    if (deployTarget === 'vercel') {
        return { isVercel: true, source: 'vite_env' }
    }

    const host = typeof window !== 'undefined' ? String(window.location.hostname || '').toLowerCase() : ''
    if (host.includes('vercel.app')) {
        return { isVercel: true, source: 'hostname' }
    }

    return { isVercel: false, source: 'default' }
}