A loader for webpack that lets you import xml files as a string minified.
npm install --save-dev xml-minify-loader
Use the loader either via your webpack config, CLI or inline.
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /locale\/messages\.[a-z\-_]+\.xml$/,
use: 'xml-minify-loader'
}
]
}
}
In your application
import translations from './locale/messages.fr.xml';
In your application
import translations from 'xml-minify-loader!./locale/messages.fr.xml';
MIT
This project was built with or inspired by these resources,