gulp-react-intl-messages
v1.1.0
Published
Gulp plugin for extracting default messages defined with react-intl's defineMessages API into a single file.
Downloads
2
Maintainers
Readme
gulp-react-intl-messages
Extract React Intl default messages into one file with babel-plugin-react-intl
Install
npm install --save-dev gulp-react-intl-messages
yarn add --dev gulp-react-intl-messages
Usage
const gulp = require('gulp')
const reactIntlMessages = require('gulp-react-intl-messages')
gulp.src('/path/to/messages/**/*.js').pipe(reactIntlMessages({
filename: 'all-react-intl-default-messages.json',
// whatever babel options your src'd files need
babel: { plugins: ['react-intl'] }
}).pipe(gulp.dest('dist'))
API
reactIntlMessages([options])
options
filename
Name of resulting file (extension will be coerced to .json). Defaults to "gulp-react-intl-messages.json".
babel
See the Babel options. Defaults to { plugins: ['react-intl'] }
.