react-intl-cra
Extract messages of Creact React App
from the command line.
This is just a workaround for create-react-app #1227 and react-intl #869 in unofficial way.
Demo
Standalone example based on Create-React-App: https://github.com/evenchange4/react-intl-po-example
Installation
$ npm i react-intl-cra --save-dev
Usage
$ react-intl-cra './src*.js' './messages.json'
Output
[
{
"id": "Account.account",
"description": "Title",
"defaultMessage": "帳戶",
"filepath": "./src/containers/Account/messages.js"
},
{
"id": "Account.myTestDevices",
"defaultMessage": "我的測試裝置",
"filepath": "./src/containers/Account/messages.js"
},
...
]
API
First - srcPattern | The pattern of React component files |
Second - desPath | The output pathname of the .json file. |