babel-plugin-transform-dev-warning
Remove development warning from production code
Last updated 5 years ago .
· Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-dev-warning 
SYNC missed versions from official npm registry.

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

Via .babelrc (Recommended)

.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

Current Tags

  • 0.1.1                                ...           latest (5 years ago)

2 Versions

  • 0.1.0                                ...           7 years ago
  • 0.1.1                                ...           5 years ago
Maintainers (1)
Dependencies (0)
None
Dev Dependencies (8)

Copyright © npmmirror.com | 浙ICP备15033595号-63 |