forked from iii6code/III6Dojo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
36 lines (35 loc) · 1.13 KB
/
webpack.config.js
File metadata and controls
36 lines (35 loc) · 1.13 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
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { LoaderOptionsPlugin } = require("webpack");
module.exports = {
mode: "development",
entry: {
main: path.resolve(__dirname, "src/app.js"),
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].[contenthash].js",
clean: false,
},
module: {
rules: [
{ test: /\.s[ac]ss$/i, use: ["style-loader", "css-loader", "sass-loader"] },
{ test: /\.(svg|png|ico|wepg|jpg|jpeg|gif)$/, use: ["asset/resource"] },
],
},
devtool: "inline-source-map",
devServer: {
watchFiles: path.resolve(__dirname, "build"),
compress: true,
client: {
reconnect: true,
},
allowedHosts: ["127.0.0.1"],
port: 8080,
open: true,
hot: true,
liveReload: true,
},
plugins: [new HtmlWebpackPlugin({ title: "DOJOv2", file: "index.html", template: "public/app.html" }), new CopyWebpackPlugin({ patterns: [{ from: "public/images", to: "images" }] }), new CopyWebpackPlugin({ patterns: [{ from: "public/json", to: "json" }] })],
};