json-translations-webpack-plugin

2.0.0 • Public • Published

json-translations-webpack-plugin

Webpack plugin for generating json from translations endpoint

Installation

npm install json-translations-webpack-plugin

Usage

// webpack.config.js
const JSONTranslationsPlugin = require('json-translations-webpack-plugin');

module.exports = {
  // ...
  plugins: [
    // ...
    new JSONTranslationsPlugin({
      url: 'https://www.example.com/translations',
      output: 'assets/i18n',
      languages: ['en', 'de', 'fr']
    })
  ]
  // ...
};

This will create files en.json, de.json, fr.json in assets/i18n output directory, with content received from following endpoints:

  • https://www.example.com/translations/en
  • https://www.example.com/translations/de
  • https://www.example.com/translations/fr

Package Sidebar

Install

npm i json-translations-webpack-plugin

Weekly Downloads

3

Version

2.0.0

License

MIT

Unpacked Size

3.69 kB

Total Files

4

Last publish

Collaborators

  • geeksoft