@traduki/webpack-plugin-traduki
v0.11.0
Published
Webpack plugin for Traduki
Downloads
6
Maintainers
Readme
@traduki/webpack-plugin-traduki
See main github repository readme.md
Examples
Install
npm install --save-dev @traduki/webpack-plugin-traduki
npm install @traduki/runtime # or @traduki/react if you're using React
Usage
Create a webpack.config.js configuration file and configure the plugin and loader:
// webpack.config.js
const TradukiWebpackPlugin = require('@traduki/webpack-plugin-traduki');
module.exports = {
// ...
plugins: [
new TradukiWebpackPlugin({
/*
* Description: File name of the precompiled messages bundles
* Default: '[name].[locale].js'
*/
filename: '[name].[locale].js',
/*
* Description: Check consistency of messages keys for each locale
* Default: 'warn'
*/
strict: 'warn', // false | 'error'
}),
],
module: {
rules: [
// ...
{
test: /\.messages\.yaml$/,
use: TradukiWebpackPlugin.loader,
},
// ...
],
},
// ...
};