-
Notifications
You must be signed in to change notification settings - Fork 10
/
webpack.config.js
42 lines (41 loc) · 857 Bytes
/
webpack.config.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
const path = require( 'path' );
const webpack = require( 'webpack' );
const TerserPlugin = require( 'terser-webpack-plugin' );
module.exports = {
entry: {
'quicklink.min': path.resolve( __dirname, './build/js/quicklink.js' ),
'quicklink.bundle': path.resolve( __dirname, './build/js/quicklink.js' ),
},
mode: 'production',
optimization: {
minimizer: [
new TerserPlugin( {
include: /\.min\.js$/,
} ),
],
},
output: {
path: path.resolve( __dirname, './build' ),
filename: '[name].js',
},
plugins: [
new webpack.ProvidePlugin( {
jQuery: 'jquery',
wp: 'wp',
} ),
],
externals: {
jquery: 'jQuery',
wp: 'wp',
},
resolve: {
modules: [
'node_modules',
],
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader', include: path.resolve( __dirname, 'build' ) },
],
},
};