From 08b712c84a56b7e0a24c2bb94fcba640c30cf8d8 Mon Sep 17 00:00:00 2001 From: Peramanathan Sathyamoorthy Date: Mon, 16 Jan 2017 09:07:47 +0100 Subject: [PATCH] Update README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 796deb1..2587a3e 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,9 @@ export default defineMessages({ } ``` +Even better use the root directory so it will place the messages file +where the component exists. So they files are co-located + #### Options - **`messagesDir`**: The target location where the plugin will output a `.js` file corresponding to each component from which messages were extracted. If not provided, the extracted message descriptors will only be accessible via Babel's API. @@ -74,10 +77,10 @@ $ babel --plugins react-intl-messages-generator script.js ### Via Node API -The extract message descriptors are available via the `metadata` property on the object returned from Babel's `transform()` API: +The explicit texts converted as descriptors are available via the `metadata` property on the object returned from Babel's `transform()` API: ```javascript require('babel-core').transform('code', { plugins: ['react-intl-messages-generator'] -}) // => { code, map, ast, metadata['react-intl-defineMessages'].messages }; +}) // => { code, map, ast, metadata['react-intl-defineMessages'].generatedDescriptors }; ```