-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.build.js
58 lines (49 loc) · 1.14 KB
/
webpack.build.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
50
51
52
53
54
55
56
57
58
const TerserPlugin = require('terser-webpack-plugin'),
Webpack = require('webpack');
const config = {
mode: 'production',
context: `${__dirname}/src`,
entry: {
'tiny': './index.js',
'tiny.mini': './mini.js',
'tiny.base': './base.js'
},
output: {
path: `${__dirname}/build/`,
filename: `[name].js`,
environment: {
arrowFunction: false
}
},
performance: {
hints: false
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
include: /\.js$/,
parallel: true,
terserOptions: {
sourceMap: false,
compress: true,
ie8: false,
ecma: 5,
output: {
comments: false
},
warnings: false
}
})
]
},
plugins: [
new Webpack.DefinePlugin({
__DEBUG__: 'false'
})
],
stats: {
colors: true
}
};
module.exports = config;