-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.babel.js
49 lines (47 loc) · 1.17 KB
/
webpack.config.babel.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 DIST_PATH = path.resolve( './src/assets/js' );
const TerserPlugin = require('terser-webpack-plugin');
const config = {
cache: true,
entry: {
"bco-checkout": './src/assets/js/bco-checkout.js',
},
output: {
path: DIST_PATH,
filename: '[name].min.js',
},
resolve: {
modules: [ 'node_modules' ],
},
devtool: 'source-map',
mode: process.env.NODE_ENV,
plugins: [
new webpack.NoEmitOnErrorsPlugin()
],
stats: {
colors: true,
},
externals: {
jquery: 'jQuery',
},
optimization: {
minimize: process.env.NODE_ENV === 'production',
minimizer: [
new TerserPlugin({
parallel: true,
sourceMap: true,
terserOptions: {
output: {
comments: false,
},
compress: {
drop_console: true
}
},
extractComments: false,
}),
],
},
};
module.exports = config;