A babel plugin to transform __DEV__
and __PROD__
expressions.
yarn add @iaziz786/babel-plugin-transform-dev-prod-expression
It can convert this:
if (__DEV__) {
// some script to run in development mode
}
if (__PROD__) {
// some script to run in production mode
}
Into this:
if (process.env.NODE_ENV === 'development') {
// some script to run in development mode
}
if (process.env.NODE_ENV === 'production') {
// some script to run in production mode
}