File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,18 +62,18 @@ function isDevRuntime(): boolean {
6262 return explicitDevFlag
6363 }
6464
65- const metaEnv = ( import . meta as unknown as { env ?: Record < string , unknown > } ) . env
66- if ( metaEnv && typeof metaEnv . DEV === 'boolean' ) {
67- return metaEnv . DEV
65+ if ( typeof process !== 'undefined' ) {
66+ const nodeEnv = process . env ?. NODE_ENV
67+ if ( nodeEnv ) {
68+ return nodeEnv !== 'production'
69+ }
6870 }
69- if ( metaEnv && typeof metaEnv . MODE === 'string' ) {
70- return metaEnv . MODE !== 'production'
71+
72+ if ( typeof document !== 'undefined' ) {
73+ return Boolean ( document . querySelector ( 'script[src*="/@vite/client"]' ) )
7174 }
7275
73- if ( typeof process === 'undefined' ) return false
74- const nodeEnv = process . env ?. NODE_ENV
75- if ( ! nodeEnv ) return false
76- return nodeEnv !== 'production'
76+ return false
7777}
7878
7979const warnedImmutableAttrs = new WeakMap < HTMLElement , Set < string > > ( )
You can’t perform that action at this time.
0 commit comments