https://github.com/oliviertassinari/babel-plugin-transform-dev-warning
Remove development warning from production code
https://github.com/oliviertassinari/babel-plugin-transform-dev-warning
babel babel-plugin dev warning
Last synced: about 1 year ago
JSON representation
Remove development warning from production code
- Host: GitHub
- URL: https://github.com/oliviertassinari/babel-plugin-transform-dev-warning
- Owner: oliviertassinari
- Created: 2015-12-24T11:01:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-07-20T15:20:12.000Z (almost 7 years ago)
- Last Synced: 2025-03-18T01:43:08.124Z (about 1 year ago)
- Topics: babel, babel-plugin, dev, warning
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Babel Plugin for removing warning call
[](https://travis-ci.org/oliviertassinari/babel-plugin-transform-dev-warning)
[](https://www.npmjs.com/package/babel-plugin-transform-dev-warning)
[](https://www.npmjs.com/package/babel-plugin-transform-dev-warning)
This plugin removes development warning from production code.
It's recommended to be used with https://github.com/BerkeleyTrue/warning.
## Example
**In**
```js
warning(condition, argument, argument);
```
**Out**
```js
if (process.env.NODE_ENV !== 'production') {
warning(condition, argument, argument);
}
```
## Installation
```sh
$ npm install --save-dev babel-plugin-transform-dev-warning
```
## Usage
#### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"env": {
"production": {
"plugins": ["transform-dev-warning"]
}
}
}
```
#### Via CLI
```sh
$ babel --plugins transform-dev-warning script.js
```
#### Via Node API
```js
require("babel-core").transform("code", {
plugins: ["transform-dev-warning"]
});
```
## License
MIT