用于国际化键检查的 Webpack 插件
English | 简体中文
npm i i18n-check-keys-webpack-plugin -D
# or
yarn add i18n-check-keys-webpack-plugin -D
# or
pnpm add i18n-check-keys-webpack-plugin -D
const I18nCheckKeysWebpackPlugin = require('i18n-check-keys-webpack-plugin')
// webpack config
module.exports = {
plugins: [
new I18nCheckKeysWebpackPlugin({
localePath: /locale/,
benchmarkLang: 'zh_CN', // 基准语言
needStopRun: process.env.NODE_ENV === 'production', // 在打包时检查到有缺失就停止进程
}),
],
}
该插件为 i18n-check-keys
的封装,具体配置请查看原文档
Document