-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
102 lines (101 loc) · 2.84 KB
/
Copy pathwebpack.config.js
File metadata and controls
102 lines (101 loc) · 2.84 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: ["./src/js/index.js"],
output: {
path: path.resolve(__dirname, "dist"),
filename: "js/bundle.js",
},
devServer: {
contentBase: "./dist",
},
plugins: [
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/index.html",
}),
new HtmlWebpackPlugin({
filename: "404.html",
template: "./src/404.html",
}),
new HtmlWebpackPlugin({
filename: "blog.html",
template: "./src/blog.html",
}),
new HtmlWebpackPlugin({
filename: "./blog/intro-tailwindcss.html",
template: "./src/articles/intro-tailwindcss.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "./blog/tinderellas-data-chart-bars.html",
template: "./src/articles/tinderellas-data-chart-bars.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "./blog/sign-up-linkedin-rails.html",
template: "./src/articles/sign-up-linkedin-rails.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "resources.html",
template: "./src/resources.html",
}),
new HtmlWebpackPlugin({
filename: "./resources/bamboosticks.html",
template: "./src/resources/bamboosticks.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "./blog/algolia-autocomplete-predictions-rails.html",
template: "./src/articles/algolia-autocomplete-predictions-rails.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "./blog/passing-referral-codes-in-rails.html",
template: "./src/articles/passing-referral-codes-in-rails.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "./blog/custom-and-vanity-urls-rails.html",
template: "./src/articles/custom-and-vanity-urls-rails.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "./resources/gradient-hover-effect.html",
template: "./src/resources/gradient-hover-effect.html",
minify: false,
}),
new HtmlWebpackPlugin({
filename: "./resources/flippable-card.html",
template: "./src/resources/flippable-card.html",
minify: false,
}),
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
}),
],
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"postcss-loader",
"sass-loader",
],
},
],
},
};