I18nWebpackPlugin

I18nWebpackPlugin

i18n (localization) plugin for Webpack.

Install

npm i -D i18n-webpack-plugin

Usage

This plugin creates bundles with translations baked in. So you can serve the translated bundle to your clients.

see webpack/webpack/examples/i18n.

Options

plugins: [
  ...
  new I18nPlugin(languageConfig, optionsObj)
],
  • optionsObj.functionName: the default value is __, you can change it to other function name.
  • optionsObj.failOnMissing: the default value is false, which will show a warning message, if the mapping text cannot be found. If set to true, the message will be an error message.
  • optionsObj.hideMessage: the default value is false, which will show the warning/error message. If set to true, the message will be hide.

© JS Foundation and other contributors
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/plugins/i18n-webpack-plugin

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部