From aaf900f3194ce8593a011fbd7562f2030cc00cdd Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Mon, 17 Jul 2017 23:36:33 +0800 Subject: [PATCH] update locale packaging config --- build/locale.js | 8 ++++++++ build/webpack.dist.locale.config.js | 15 ++------------- 2 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 build/locale.js diff --git a/build/locale.js b/build/locale.js new file mode 100644 index 0000000..82efcb6 --- /dev/null +++ b/build/locale.js @@ -0,0 +1,8 @@ +const readDir = require('fs').readdirSync +const files = readDir('./src/locale/lang') +const entry = {} +files.forEach(file => { + const name = file.split('.')[0] + entry[name] = './src/locale/lang/' + file +}) +module.exports = entry \ No newline at end of file diff --git a/build/webpack.dist.locale.config.js b/build/webpack.dist.locale.config.js index a20e840..a95eecb 100644 --- a/build/webpack.dist.locale.config.js +++ b/build/webpack.dist.locale.config.js @@ -1,21 +1,10 @@ var path = require('path'); var webpack = require('webpack'); - +var entry = require('./locale'); process.env.NODE_ENV = 'production'; module.exports = { - entry: { - 'de-DE': './src/locale/lang/de-DE.js', - 'en-US': './src/locale/lang/en-US.js', - 'es-ES': './src/locale/lang/de-DE.js', - 'fr-FR': './src/locale/lang/zh-CN.js', - 'ja-JP': './src/locale/lang/zh-CN.js', - 'pt-BR': './src/locale/lang/zh-CN.js', - 'ru-RU': './src/locale/lang/zh-CN.js', - 'tr-TR': './src/locale/lang/tr-TR.js', - 'zh-CN': './src/locale/lang/zh-CN.js', - 'zh-TW': './src/locale/lang/zh-TW.js' - }, + entry, module: { rules: [ { -- libgit2 0.21.4