0.0.6 • Published 5 years ago

polyglot-po-loader v0.0.6

Weekly downloads
2
License
Apache-2.0
Repository
-
Last release
5 years ago

polyglot-po-loader

Webpack loader to load po file and convert them to polyglot json format readme

Install

$ npm install -g polyglot-po-loader
# or
$ yarn global add polyglot-po-loader

Usage

Add the csv-loader to your webpack configuration:

const config = {
    module: {
        rules: [{
            test: /\.po$/,
            loader: 'polyglot-po-loader',
        }]
    }

With create-react-app

You will need react-app-rewired to add the loader into the webpack-config.

With react-app-rewired, you can edit the webpack config inside the config-overrides.js.

There is a gotcha though, the create-react-app default webpack configuration possess a catch all file-loader.

For polyglot-po-loader to properly work, you need to pass it before this loader, like so:

// config-overrides.js
const path = require('path');

module.exports = config => {
    const lastLoader = config.module.rules.pop();

    lastLoader.oneOf.unshift({
        test: /\.po$/,
        use: [{
            loader: 'polyglot-po-loader',
        }],
    });

    config.module.rules.push(lastLoader);

    return config;
};
0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago