Skip to content

isDev

isDev(): boolean

Defined in: internal/dev.ts:12

Internal

Dev-mode predicate. Returns true unless the bundler/runtime has marked the build as production (process.env.NODE_ENV === "production").

Vite, esbuild, webpack, and tsup all replace process.env.NODE_ENV at build time with a string literal when NODE_ENV is set, which lets the if (isDev()) guarded warning paths be tree-shaken out of minified production bundles.

boolean