Skip to content

Commit 343a97a

Browse files
[Docs] Improve the README
1 parent 94c6978 commit 343a97a

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
# Babel plugin for removing React properties
1+
# babel-plugin-react-remove-properties
2+
3+
> Babel plugin for removing React properties.
24
35
[![Build Status](https://travis-ci.org/oliviertassinari/babel-plugin-react-remove-properties.svg?branch=master)](https://travis-ci.org/oliviertassinari/babel-plugin-react-remove-properties)
46
[![npm version](https://img.shields.io/npm/v/babel-plugin-react-remove-properties.svg?style=flat-square)](https://www.npmjs.com/package/babel-plugin-react-remove-properties)
57
[![npm downloads](https://img.shields.io/npm/dm/babel-plugin-react-remove-properties.svg?style=flat-square)](https://www.npmjs.com/package/babel-plugin-react-remove-properties)
68

7-
This is useful when using selectors like data-test to run selenium test. Those properties are useless when running the code in production. You can save bandwidth by removing them.
9+
[![Dependencies](https://img.shields.io/david/oliviertassinari/babel-plugin-react-remove-properties.svg?style=flat-square)](https://david-dm.org/oliviertassinari/babel-plugin-react-remove-properties)
10+
[![DevDependencies](https://img.shields.io/david/dev/oliviertassinari/babel-plugin-react-remove-properties.svg?style=flat-square)](https://david-dm.org/oliviertassinari/babel-plugin-react-remove-properties#info=devDependencies&view=list)
11+
12+
## Installation
13+
14+
```sh
15+
npm install --save-dev babel-plugin-react-remove-properties
16+
```
17+
18+
## The problem solved
19+
20+
This is useful when using selectors like data-test to run selenium test. Those properties are useless when running the code in production. You can **save bandwidth** by removing them.
821

922
## Example
1023

@@ -34,20 +47,14 @@ class Foo extends React.Component {
3447
}
3548
```
3649

37-
## Installation
38-
39-
```sh
40-
npm install --save-dev babel-plugin-react-remove-properties
41-
```
42-
4350
## Usage
4451

4552
#### Via `.babelrc` (Recommended)
4653

4754
**.babelrc**
4855

4956
without options
50-
```js
57+
```json
5158
{
5259
"env": {
5360
"production": {
@@ -58,7 +65,7 @@ without options
5865
```
5966

6067
with options
61-
```js
68+
```json
6269
{
6370
"env": {
6471
"production": {
@@ -70,7 +77,7 @@ with options
7077

7178
the options also accepts an array of property names
7279

73-
```js
80+
```json
7481
{
7582
"env": {
7683
"production": {
@@ -89,8 +96,8 @@ babel --plugins react-remove-properties script.js
8996
#### Via Node API
9097

9198
```js
92-
require("babel-core").transform("code", {
93-
plugins: ["react-remove-properties"]
99+
require('babel-core').transform('code', {
100+
plugins: ['react-remove-properties']
94101
});
95102
```
96103

0 commit comments

Comments
 (0)