Skip to content

Commit 6b91e70

Browse files
[README] minor tweaks
1 parent 38eab21 commit 6b91e70

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ npm install --save-dev babel-plugin-transform-react-remove-prop-types
1717

1818
## The problem solved
1919

20-
2120
Remove React `propTypes` from the production build, as they are only used in development.
2221
You can **save bandwidth** by removing them.
2322

@@ -109,6 +108,7 @@ require('babel-core').transform('code', {
109108
## Options
110109

111110
### `mode`
111+
112112
- `remove` (default):
113113
the `propTypes` definitions are removed from the source code.
114114
- `wrap`:
@@ -122,12 +122,19 @@ if (process.env.NODE_ENV !== "production") {
122122
The `wrap` mode is targeting react libraries like [material-ui](https://github.com/callemall/material-ui).
123123
It's not intended to be used in userland.
124124

125+
### `removeImport`
126+
127+
- `true`: the import statements are removed as well. This option only works if `mode` is set to `remove`:
128+
```js
129+
import PropTypes from 'prop-types'
130+
```
131+
- `false` (default): does not remove the import statements.
125132

126133
### `ignoreFilenames`
127134

128135
This filter generates a regular expression.
129136
Any filenames containing one of the array's strings will be ignored.
130-
By default, we match everything.
137+
By **default**, we match everything.
131138

132139
Following the [Is it safe?](#user-content-is-it-safe) section, you might encounter a component
133140
depending on the `propTypes` at runtime to work.
@@ -137,14 +144,6 @@ For instance, you can ignore all the npm modules:
137144
ignoreFilenames: ['node_modules'],
138145
```
139146

140-
### `removeImport`
141-
- `true`
142-
This removes the `import PropTypes from 'proptypes'` as well.
143-
This option only works if `mode` is set to `remove`
144-
- `false` (default):
145-
Does not remove any import statements.
146-
147-
148147
## Is it safe?
149148

150149
If you are using the `propTypes` in a conventionnal way,

0 commit comments

Comments
 (0)