-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
88 lines (87 loc) · 2.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const ImageminPlugin = require("imagemin-webpack-plugin").default;
const RobotstxtPlugin = require("robotstxt-webpack-plugin");
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
mode: process.env.NODE_ENV === "production" ? "production" : "development",
entry: ["jquery", "./src/js/index.js"],
module: {
rules: [
{
test: /\.scss$/,
use: [
{
loader: "file-loader",
options: {
name: "./static/[name].bundle.css"
}
},
{
loader: "extract-loader"
},
{
loader: "css-loader?-url"
},
{
loader: "postcss-loader"
},
{
loader: "sass-loader"
}
]
}
]
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: "Dead Matter | Quantum Integrity Software Inc.",
template: "./src/index.html"
}),
new HtmlWebpackPlugin({
title: "About | Quantum Integrity Software Inc.",
filename: "about.html",
template: "./src/about.html"
}),
new HtmlWebpackPlugin({
title: "Media | Quantum Integrity Software Inc.",
filename: "media.html",
template: "./src/media.html"
}),
new HtmlWebpackPlugin({
title: "A New Name | Quantum Integrity Software Inc.",
filename: "anewname.html",
template: "./src/anewname.html"
}),
new HtmlWebpackPlugin({
title: "Press Kit | Quantum Integrity Software Inc.",
filename: "presskit.html",
template: "./src/presskit.html"
}),
new HtmlWebpackPlugin({
title: "404 | Quantum Integrity Software Inc.",
filename: "404.html",
template: "./src/404.html"
}),
new CopyWebpackPlugin([{ from: "./src/assets", to: "./" }]),
new ImageminPlugin({
disable: process.env.NODE_ENV !== "production",
test: /\.(jpe?g|png|gif|svg)$/i,
pngquant: {
quality: "90-100"
}
})
],
resolve: {
extensions: [".js", ".scss", ".css"]
},
devServer: {
contentBase: "./dist"
},
output: {
filename: "./js/[name].bundle.js",
path: path.resolve(__dirname, "dist")
}
};