forked from AlanZhang001/H5CallUpNative
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
36 lines (35 loc) · 996 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 path = require('path');
var UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = env => {
var isProdEnv = env && env.prod;
return {
entry: {
index: './src/index.js'
},
resolve: {
modules: [
'./src',
'node_modules'
]
},
devtool: isProdEnv ? 'hidden-source-map' : 'source-map',
plugins: isProdEnv ? [
new UglifyJsPlugin({
parallel: true,
cache: path.resolve(__dirname, './.tmp/jscache2'),
uglifyOptions: {
compress: {
drop_console: true
}
}
})
] : undefined,
output: {
path: path.resolve(__dirname, './'),
filename: '[name].js',
pathinfo: isProdEnv ? false : true,
libraryTarget: 'umd',
library: 'Callup'
}
}
};