-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
43 lines (42 loc) · 912 Bytes
/
webpack.dev.js
File metadata and controls
43 lines (42 loc) · 912 Bytes
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
const config = require("./webpack.config");
const { merge } = require("webpack-merge");
const path = require("path");
module.exports = merge(config, {
mode: "development",
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "src"),
},
module: {
rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
"style-loader", // inject css to DOM
"css-loader", // turn css to commonjs
"sass-loader", // turn scss to css
],
},
{
test: /\.(svg|png|jpg|gif)$/,
use: {
loader: "file-loader",
options: {
name: "[name].[ext]",
},
},
},
],
},
output: {
publicPath: "/",
},
devtool: "source-map",
devServer: {
contentBase: path.join(__dirname, "src"),
watchContentBase: true,
hot: true,
open: true,
inline: true,
},
});