# localization-webpack-plugin

> Localization webpack plugin. Create separate JSON files for every chunk.

Latest version **0.0.7** (published 2017-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install localization-webpack-plugin
pnpm add localization-webpack-plugin
yarn add localization-webpack-plugin
bun add localization-webpack-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2017-10-22 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexey Duryagin |
| Maintainers | aiduryagin |
| Keywords | webpack, i18n, localization, plugin |

## Links

- npm: https://www.npmjs.com/package/localization-webpack-plugin
- Repository: https://github.com/aiduryagin/localization-webpack-plugin
- Homepage: https://github.com/aiduryagin/localization-webpack-plugin#readme
- Issues: https://github.com/aiduryagin/localization-webpack-plugin/issues
- npm.io page: https://npm.io/package/localization-webpack-plugin

## Dependencies (2)

- [merge](https://npm.io/package/merge.md) ^1.2.0
- [webpack](https://npm.io/package/webpack.md) ^3.8.1

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2017-10-22
- 0.0.6 — 2017-10-22
- 0.0.5 — 2017-10-21
- 0.0.4 — 2017-10-20
- 0.0.3 — 2017-10-20
- 0.0.2 — 2017-10-20
- 0.0.1 — 2017-10-20

## README

# LocalizationWebpackPlugin
Make separate JSON localization files for every chunk

* [See demo](https://warm-savannah-71686.herokuapp.com/)
* [See source of demo](https://github.com/aiduryagin/localization-webpack-plugin-demo)

## Usage
This plugin creates merged JSON files with translations for cunks. One JSON file by one chunk.
To get link to JSON file with translations you need to write in code 

```javascript
// 'chunkLocalizationURL: {"chunkName": "warAndPeace", "lang": "en"}' will be replaced by 'warAndPeace.en.json'
const linksToTranslationFiles = {
  warAndPeaceEN: 'chunkLocalizationURL: {"chunkName": "warAndPeace", "lang": "en"}',
  warAndPeaceRU: 'chunkLocalizationURL: {"chunkName": "warAndPeace", "lang": "ru"}'
};
```

## Options
```javascript
plugins: [
  ...
  new LocalizationWebpackPlugin({
    filename: '[chunkname].[lang].json', // Avaible: [chunkname], [hash], [lang]
    locales: ['en', 'ru'],
  }),
],
```
* `filename`: the default value is `[chunkname].[lang].json` Avaible tags is `[chunkname], [hash], [lang]`
* `locales`: the default value is `['en']`

---
_Source: https://npm.io/package/localization-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
