Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 months 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 (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-07-20T15:20:12.000Z (over 5 years ago)
- Last Synced: 2024-10-12T23:13:44.813Z (3 months 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
[![Build Status](https://travis-ci.org/oliviertassinari/babel-plugin-transform-dev-warning.svg?branch=master)](https://travis-ci.org/oliviertassinari/babel-plugin-transform-dev-warning)
[![npm version](https://img.shields.io/npm/v/babel-plugin-transform-dev-warning.svg?style=flat-square)](https://www.npmjs.com/package/babel-plugin-transform-dev-warning)
[![npm downloads](https://img.shields.io/npm/dm/babel-plugin-transform-dev-warning.svg?style=flat-square)](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