@@ -18,15 +18,7 @@ import type { SolidUplotPluginBus, UplotPluginFactory, VoidStruct } from "./crea
1818import { createCursorMovePlugin , type OnCursorMoveParams } from "./eventPlugins" ;
1919import { getSeriesData , type SeriesDatum } from "./utils/getSeriesData" ;
2020
21- const __DEV__ = ( ( ) => {
22- try {
23- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24- const g = globalThis as any ;
25- return g . process ?. env ?. NODE_ENV !== "production" ;
26- } catch {
27- return false ;
28- }
29- } ) ( ) ;
21+ const __DEV__ = import . meta. env . DEV ;
3022
3123/** Placement options for children components relative to the chart */
3224type ChildrenPlacement = "top" | "bottom" ;
@@ -277,12 +269,12 @@ export const SolidUplot = <T extends VoidStruct = VoidStruct>(
277269 for ( const entry of entries ) {
278270 const { width, height } = entry . contentRect ;
279271
280- if ( ! hasWarnedZeroHeight && height === 0 && __DEV__ ) {
272+ if ( height === 0 && ! hasWarnedZeroHeight && __DEV__ ) {
281273 hasWarnedZeroHeight = true ;
282274 console . warn (
283275 "[SolidUplot] autoResize observed 0px height. " +
284- "Ensure the parent container has an explicit height " +
285- "or is within a flex/grid layout that provides height." ,
276+ "Ensure the parent container has an explicit height " +
277+ "or is within a flex/grid layout that provides height." ,
286278 ) ;
287279 }
288280
0 commit comments