-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
60 lines (58 loc) · 1.39 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
var HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
target: "web",
mode: "development",
entry: "./client/main.js",
output: {
path: __dirname + "/assets/dist",
publicPath: "/assets/dist/", // Final slash is important for hot reloading webpack-dev-server/issues/252
filename: "main-[contenthash].js",
},
devtool: "source-map",
module: {
rules: [
{
test: /\.scss$/,
use: [
"style-loader",
MiniCssExtractPlugin.loader,
"css-loader",
{
loader: "sass-loader",
options: {
sassOptions: {
includePaths: [
"node_modules/bootstrap/scss",
"node_modules/animate.css/source"
],
},
},
},
]
},
{
test: /\.hbs$/,
loader: "handlebars-loader",
include: /client/,
},
]
},
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: "main-[contenthash].css",
}),
new HtmlWebpackPlugin({
filename: "../../server/pages/layouts/dist/main.layout.hbs",
template: "./server/pages/layouts/src/main.layout.hbs",
inject: false,
}),
new HtmlWebpackPlugin({
filename: "../../server/pages/layouts/dist/oneColumn.layout.hbs",
template: "./server/pages/layouts/src/oneColumn.layout.hbs",
inject: false,
}),
],
}