{"library":"react-intl-webpack-plugin","title":"react-intl-webpack-plugin","description":"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.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install react-intl-webpack-plugin"],"cli":null},"imports":["const ReactIntlPlugin = require('react-intl-webpack-plugin');\n// or\nimport ReactIntlPlugin from 'react-intl-webpack-plugin';","ReactIntlPlugin.metadataContextFunctionName"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nconst ReactIntlPlugin = require('react-intl-webpack-plugin');\n\nmodule.exports = {\n  // ... other config\n  module: {\n    rules: [\n      {\n        test: /\\.jsx?$/,\n        exclude: /node_modules/,\n        use: {\n          loader: 'babel-loader',\n          options: {\n            cacheDirectory: true,\n            metadataSubscribers: [ReactIntlPlugin.metadataContextFunctionName],\n            plugins: [\n              '@babel/plugin-transform-runtime',\n              ['react-intl', { enforceDescriptions: false }]\n            ],\n            presets: ['@babel/preset-env', '@babel/preset-react']\n          }\n        }\n      }\n    ]\n  },\n  plugins: [\n    new ReactIntlPlugin()\n  ]\n};","lang":"javascript","description":"Configures webpack with babel-loader and react-intl-webpack-plugin for i18n message extraction.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}