@traduki/webpack-plugin-traduki

0.11.0 • Public • Published

@traduki/webpack-plugin-traduki

npm

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,
            },
            // ...
        ],
    },
    // ...
};

Dependencies (4)

Dev Dependencies (8)

Package Sidebar

Install

npm i @traduki/webpack-plugin-traduki

Weekly Downloads

0

Version

0.11.0

License

MIT

Unpacked Size

29.2 kB

Total Files

28

Last publish

Collaborators

  • havelaer