is-dev
v0.2.1
Published
Leverage export conditions to know whether the environment is development or production(/staging/...).
Readme
Leverage export conditions to know whether the environment is development or production(/staging/...).
import { isDev } from 'is-dev'
// returns true in development
// returns false in production(/staging/...)
console.log(isDev)How it works is dead simple:
// node_modules/is-dev/package.json
"exports": {
"development": "./export-true.mjs",
"default": "./export-false.mjs"
}Currently works in:
✅ Vite
❌ Node.js
[!NOTE] Once Vite uses Rolldown (i.e. full-bundle mode), this package will work for Vite-based app.
