-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.devconfig.js
More file actions
76 lines (74 loc) · 1.73 KB
/
webpack.devconfig.js
File metadata and controls
76 lines (74 loc) · 1.73 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
const webpack = require("webpack");
const merge = require("webpack-merge");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const common = require("./webpack.config.js");
module.exports = merge(common, {
mode: "development",
devtool: "source-map",
devServer: {
hot: true,
contentBase: "./dist",
port: 3000,
proxy: {
"/api": "http://localhost:3001"
},
overlay: {
errors: true,
warnings: true
}
},
module: {
rules: [
{
test: /(\.css|\.scss)$/,
use: [
{
loader: "css-hot-loader"
}
].concat(
ExtractTextPlugin.extract({
use: [
{
loader: "css-loader",
options: { sourceMap: true }
},
{
loader: "postcss-loader"
},
{
loader: "sass-loader",
options: { sourceMap: true }
}
],
// use style-loader in development
fallback: "style-loader"
})
)
},
{
test: /\.js$/,
enforce: "pre",
exclude: /node_modules/,
loader: "eslint-loader",
options: {
cache: true,
configFile: ".eslintrc.js",
emitWarning: true,
// Fail only on errors
failOnWarning: false,
failOnError: false,
// Toggle autofix
fix: false,
formatter: require("eslint/lib/formatters/stylish")
}
}
]
},
plugins: [
new ExtractTextPlugin({
filename: getPath => getPath("css/[name].css"),
allChunks: true
}),
new webpack.HotModuleReplacementPlugin()
]
});