Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit d269ca1

Browse files
committed
Update README
1 parent 94672a7 commit d269ca1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# babel-plugin-react-intl
22

3-
Extracts string messages from modules that use react-intl.
3+
**THIS IS A PREVIEW RELEASE THAT WORKS WITH A FUTURE, UNRELEASED VERSION OF REACT INTL.**
4+
5+
Extracts string messages from React components that use [React Intl][].
46

57
## Installation
68

@@ -16,10 +18,17 @@ $ npm install babel-plugin-react-intl
1618

1719
```json
1820
{
19-
"plugins": ["react-intl"]
21+
"plugins": ["react-intl"],
22+
"extra": {
23+
"react-intl": {
24+
"messagesDir": "./build/messages/"
25+
}
26+
}
2027
}
2128
```
2229

30+
The `messagesDir` option is the target location where the plugin will output a `.json` file corresponding to each component from which React Intl messages were extracted.
31+
2332
### Via CLI
2433

2534
```sh
@@ -31,5 +40,8 @@ $ babel --plugins react-intl script.js
3140
```javascript
3241
require("babel-core").transform("code", {
3342
plugins: ["react-intl"]
34-
});
43+
}) // => { code, map, ast, metadata['react-intl'].messages };
3544
```
45+
46+
47+
[React Intl]: http://formatjs.io/react/

0 commit comments

Comments
 (0)