Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

babel-plugin-transform-dev-warning

oliviertassinari122.3kMIT0.1.1

Remove development warning from production code

babel, babel-plugin, warning, dev

readme

Babel Plugin for removing warning call

Build Status npm version npm downloads

This plugin removes development warning from production code. It's recommended to be used with https://github.com/r3dm/warning.

Example

In

warning(condition, argument, argument);

Out

if (process.env.NODE_ENV !== 'production') {
  warning(condition, argument, argument);
}

Installation

$ npm install --save-dev babel-plugin-transform-dev-warning

Usage

.babelrc

{
  "env": {
    "production": {
      "plugins": ["transform-dev-warning"]
    }
  }
}

Via CLI

$ babel --plugins transform-dev-warning script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-dev-warning"]
});

License

MIT