-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
45 lines (44 loc) · 1.08 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
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: "development", //production
entry: {
main: path.resolve(__dirname, "src/app.js"),
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "app.bundle.js",
},
devtool: "inline-source-map", // Keeps the path info of the files to track errors.
devServer: {
port: 5001,
open: true,
liveReload: true, // Hot reload
watchFiles: ["./**/*.html", "./**/*.scss"],
},
module: {
rules: [
{
test: /\.scss$/i,
use: [
// MiniCssExtractPlugin.loader,
"style-loader",
"css-loader",
"postcss-loader",
"sass-loader"
],
},
],
},
plugins: [
new HtmlWebpackPlugin({
title: "Gerillass Play",
filename: "index.html",
template: path.resolve(__dirname, "./src/index.html"),
}),
new MiniCssExtractPlugin({
filename: "./src/assets/css/styles.css",
}),
],
};