diff --git a/build/locale.js b/build/locale.js new file mode 100644 index 00000000..82efcb69 --- /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 a20e840d..a95eecb0 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: [ {