This webpack plugin integrates with babel-plugin-react-intl to extract and aggregate internationalization messages from React components into a single JSON file, typically named reactIntlMessages.json. Version 0.3.1 is the latest stable release. It assists in the i18n workflow by combining extracted message descriptors during the webpack build and placing the output in the webpack output directory. Compared to other i18n tools, it focuses on the extraction and aggregation step for webpack-based React projects, leveraging babel metadata. It requires babel-loader >= 6.0.0, babel-plugin-react-intl >= 2.3.0, and webpack >= 4.0.0. The plugin is designed to work with translation memory tools and a separate reactIntlJson-loader for loading translated JSON files.
npm install react-intl-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Configures webpack with babel-loader and react-intl-webpack-plugin for i18n message extraction.
Access via http://localhost:port/reactIntlMessages.json or run a production build to write the file to disk.
Delete .babel-cache or set cacheDirectory: false temporarily.
Use: const ReactIntlPlugin = require('react-intl-webpack-plugin');Run npm install react-intl-webpack-plugin --save-dev