forked from apache/echarts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
36 lines (32 loc) · 907 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var PROD = process.argv.indexOf('-p') >= 0;
var webpack = require('webpack');
var IS_EN = process.argv.indexOf('--lang-en') >= 0;
var plugins = [
new webpack.DefinePlugin({
'typeof __DEV__': JSON.stringify('boolean'),
__DEV__: PROD ? false : true
})
];
var outputSuffix = '';
if (IS_EN) {
plugins.unshift(
new webpack.NormalModuleReplacementPlugin(/\/lang[.]js/, './langEN.js')
);
outputSuffix = '-en';
}
module.exports = {
plugins: plugins,
entry: {
'echarts': __dirname + '/index.js',
'echarts.simple': __dirname + '/index.simple.js',
'echarts.common': __dirname + '/index.common.js'
},
output: {
libraryTarget: 'umd',
library: 'echarts',
path: __dirname + '/dist',
filename: PROD
? '[name]' + outputSuffix + '.min.js'
: '[name]' + outputSuffix + '.js'
}
};