-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.prod.js
44 lines (42 loc) · 902 Bytes
/
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
'use strict';
const path = require('path'),
CleanWebpackPlugin = require('clean-webpack-plugin'),
webpack = require('webpack'),
UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: './src/index.js',
cache: true,
mode: 'production',
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,
}),
new UglifyJsPlugin({
parallel: 2,
uglifyOptions: {
ie8: false,
ecma: 8,
compress: true,
mangle: true,
output: {
comments: false,
beautify: false,
},
},
sourceMap: true,
}),
new CleanWebpackPlugin(['dist']),
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs2',
},
target: 'node',
node: {},
module: {
rules: [],
},
// externals: nodeModules,
};