A loader that parses input JSON, YAML and Java .properties files consisting of messages as objects of JavaScript message functions with a matching structure, all during the build of your application.
If you're intending to publish a library with external dependencies, you should also include the runtime as a dependency:
npm install @messageformat/runtime
Usage
After installation, you'll need to add the loader to your Webpack config.
Note the test value; you may want to customise the messages part to match whatever you're actually using, in particular if a generic match like /\.yaml$/ would overlap with another loader.
As MessageFormat is often used to provide multi-language support, it's important to include all of your supported locales in the options.locale value.
For example, using locale: ['en', 'fr'] would allow for imports from foo.en.properties and foo.fr.properties to have their messages' locale set correctly, based on the file name.
Using a locale identifier as a key within the message file contents will also select that locale within it.