Webpack loader that compiles MessageFormat ICU message strings into JavaScript modules at build time. Supports JSON, YAML, and JS source files containing ICU MessageFormat strings. Compatible with messageformat 1.x and 2.x. The loader transforms message resources into pre-compiled functions for efficient runtime internationalization. While the core messageformat library has moved to v4 (prerelease) with a rewritten API and MF2 spec support, this loader remains at v0.8.1 and only supports the older 1.x/2.x versions. Key differentiator: integrates MessageFormat compilation into webpack pipeline, avoiding runtime compilation overhead.
npm install messageformat-loaderVerified import paths — ran on the pinned version, not inferred.
Configures webpack to load JSON message files and compile ICU patterns using messageformat-loader.
Use messageformat 2.x (e.g., 'messageformat': '^2.0.0') or stay on 1.x. Do not install messageformat@4.
Consider migrating to messageformat v4 and using a custom loader or runtime compilation with @messageformat/core
Always specify the 'locale' or 'locales' option matching your message files
npm install messageformat@^2.0.0
npm install messageformat@^2.0.0
Configure as `loader: 'messageformat-loader'` inside a `rules` array, not as a plugin.