-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
35 lines (32 loc) · 853 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
const path = require("path"),
TerserPlugin = require('terser-webpack-plugin'),
RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts')
// Merge webpack configs
const { merge } = require('webpack-merge')
// Common webpack config
const common = require('./webpack.common.js')
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
entry: {
"dist/js/mdsm.jquery.min": path.resolve(__dirname, "src/js/mdsm.jquery.js"),
"dist/js/mdsm.vanilla.min": path.resolve(__dirname, "src/js/mdsm.vanilla.js"),
"dist/css/mdsm.min": path.resolve(__dirname, "src/css/mdsm.sass")
},
output: {
path: path.resolve(__dirname),
filename: "[name].js",
},
plugins: [
new RemoveEmptyScriptsPlugin()
],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin()
]
},
externals: {
jquery: "jQuery",
},
})