-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.prod.js
49 lines (42 loc) · 1.09 KB
/
webpack.prod.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
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require('path');
const webpack = require('webpack');
const Uglifyjs = require('uglifyjs-webpack-plugin');
let config = {
devtool: 'hidden-source-map',
context: path.join(__dirname),
entry: {
index: path.join(__dirname, 'src/index'),
"index.worker": path.join(__dirname, 'src/webpack-worker/index'),
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].min.js',
libraryTarget:"umd",
library:"httplive",
},
resolve: {
modules: [path.resolve(__dirname, 'src'), path.resolve(__dirname, 'node_modules')]
},
module: {
rules: [{
test: /\.(js|jsx)$/,
use: [{
loader: 'babel-loader',
query: {
presets: ['es2015'],
}
}]
}]
},
plugins: [
new Uglifyjs({
uglifyOptions: {
compress: {
pure_funcs: ['console.log']
},
warnings: false
}
}),
]
}
module.exports = config;