-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.prod.js
45 lines (39 loc) · 1.04 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
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'production',
entry: './src/js/app.js',
output: {
path: path.resolve(__dirname, 'js'),
filename: 'app.min.js',
sourceMapFilename: '../js/sourcemaps/[file].map',
},
module: {
rules: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src/js'),
path.resolve(__dirname, 'node_modules/@superstructure.net'),
],
use: {
loader: 'babel-loader',
},
},
],
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
keep_fnames: true,
compress: {
drop_console: true,
},
},
}),
],
},
devtool: 'source-map',
};