-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.demo.prod.js
54 lines (49 loc) · 967 Bytes
/
webpack.demo.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
46
47
48
49
50
51
52
53
54
const HtmlWebPackPlugin = require("html-webpack-plugin"),
FaviconsWebpackPlugin = require('favicons-webpack-plugin')
// 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: {
index: {
import: './src/index.js',
// dependOn: 'jquery'
},
mdsm: {
import: './src/js/mdsm.vanilla.js',
// dependOn: 'jquery'
},
// jquery: 'jquery'
},
output: {
filename: '[name].js',
},
module: {
rules: [
// HTML
{
test: /\.html$/,
use: [
{
loader: "html-loader",
},
],
},
// Images
{
test: /\.(?:ico|gif|png|jpg|jpeg)$/i,
type: 'asset/resource',
},
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html",
}),
new FaviconsWebpackPlugin('./src/js/demo/assets/icon.svg')
]
})