-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
56 lines (56 loc) · 1.34 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const build = 0;
module.exports = {
devServer: {
port: 443,
allowedHosts: 'all',
server: {
type: 'https',
options: {
key: './key/localhost-key.pem',
cert: './key/localhost-cert.pem'
}
}
},
entry: ["./src/js/index.js", "./src/css/style.css"],
output: {
filename: "bundle.[contenthash].js",
path: path.resolve(__dirname, "OneArmedBanditTWA"),
},
performance: {
hints: false,
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
favicon: "./src/assets/favicon.ico",
template: "./src/index.html",
}),
new MiniCssExtractPlugin({
filename: "main.[contenthash].css",
}),
],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, "css-loader"],
},
{
test: /\.(jpe?g|gif|png|svg|woff|ttf|wav|mp3)$/,
type: "asset/resource",
generator: {
filename: 'icons/[hash][ext][query]'
}
},
{
test: /\.js$/,
exclude: /node_modules/,
use: "babel-loader",
},
],
},
};