@shiftcode/translation-markup-plugin
v1.0.11
Published
Webpack plugin that uses [Translation Markup](https://translationmarkup.com/) to auto generate you translations files.
Downloads
167
Readme
Translation Markup Plugin
Webpack plugin that uses Translation Markup to auto generate you translations files.
Getting Started
Translation Markup Plugin auto generates your translations files, write your transaltions only once, in YAML, and refernce the auto generated JS files to internationalize your application with any i18n library you desire.
Install
Install
NPM:
npm install @shiftcode/translation-markup-plugin
Yarn:
yarn add @shiftcode/translation-markup-plugin
Config
webpack.config.js
import TranslationMarkupPlugin from '@shiftcode/translation-markup-plugin';
{
...
plugins: [
new TranslationMarkupPlugin(options)
]
...
}
Options
| Param | Type | Default | Details |
| :-------------: | :----------------------------------------------------------------: | :-------------------------------------------------------------: | :---------------------------------------------------------------------------------: |
| globPath | <string>
| './**/*.lang.yaml'
| Glob style path where to find the yaml files. |
| outputDirectory | <string>
| './translations'
| Directory to output the translations. |
| options | { format: <string>, splitFiles: <boolean>, outputName: <string>}
| { format: 'JS', splitFiles: true, outputName: 'translations'}
| Output type and split options. |
*** format
accepts JS
JS_EXPORT_DEFAULT
, TS
or JSON
as values
→ Returns: Promise<void>