This repository was archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (53 loc) · 1.47 KB
/
Copy pathwebpack.config.js
File metadata and controls
54 lines (53 loc) · 1.47 KB
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 path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCSSExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: "development",
entry: path.resolve(__dirname, "./src/index.js"),
devtool: "inline-source-map",
devServer: {
host: "local-ipv4",
port: 8080,
liveReload: true,
watchFiles: ["src/*.js", "src/*.css", "src/*.glsl", "src/*.frag", "src/*.vert", "src/*.html"],
static: {
directory: path.join(__dirname, "public"),
},
open: true,
https: true,
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, "./src/index.html"),
minify: true,
}),
new MiniCSSExtractPlugin(),
],
module: {
rules: [
{
test: /\.(html)$/,
use: ["html-loader"],
},
{
test: /\.js$/,
exclude: /node_modules/,
use: ["babel-loader"],
},
{
test: /\.css$/,
use: [MiniCSSExtractPlugin.loader, "css-loader"],
},
{
test: /\.(glsl|vs|fs|vert|frag)$/,
exclude: /node_modules/,
use: ["raw-loader"],
},
],
},
output: {
path: path.resolve(__dirname, "./src"),
filename: "app.js",
publicPath: "/",
},
};