Commit a3a725a179905b69aaf264478180fe36f3374672
1 parent
fded311f
add locale packaging config
Showing
1 changed file
with
43 additions
and
0 deletions
Show diff stats
1 | +var path = require('path'); | |
2 | +var webpack = require('webpack'); | |
3 | + | |
4 | +process.env.NODE_ENV = 'production'; | |
5 | + | |
6 | +module.exports = { | |
7 | + entry: { | |
8 | + 'de-DE': './src/locale/lang/de-DE.js', | |
9 | + 'en-US': './src/locale/lang/en-US.js', | |
10 | + 'es-ES': './src/locale/lang/de-DE.js', | |
11 | + 'fr-FR': './src/locale/lang/zh-CN.js', | |
12 | + 'ja-JP': './src/locale/lang/zh-CN.js', | |
13 | + 'pt-BR': './src/locale/lang/zh-CN.js', | |
14 | + 'ru-RU': './src/locale/lang/zh-CN.js', | |
15 | + 'tr-TR': './src/locale/lang/tr-TR.js', | |
16 | + 'zh-CN': './src/locale/lang/zh-CN.js', | |
17 | + 'zh-TW': './src/locale/lang/zh-TW.js' | |
18 | + }, | |
19 | + module: { | |
20 | + rules: [ | |
21 | + { | |
22 | + test: /\.js$/, | |
23 | + loader: 'babel-loader', | |
24 | + exclude: /node_modules/ | |
25 | + } | |
26 | + ], | |
27 | + }, | |
28 | + output: { | |
29 | + path: path.resolve(__dirname, '../dist/locale'), | |
30 | + publicPath: '/dist/locale/', | |
31 | + filename: '[name].js', | |
32 | + library: 'iview/locale', | |
33 | + libraryTarget: 'umd', | |
34 | + umdNamedDefine: true | |
35 | + }, | |
36 | + plugins: [ | |
37 | + new webpack.DefinePlugin({ | |
38 | + 'process.env': { | |
39 | + NODE_ENV: '"production"' | |
40 | + } | |
41 | + }) | |
42 | + ] | |
43 | +} | |
0 | 44 | \ No newline at end of file | ... | ... |