-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpackDevServer.config.js
More file actions
36 lines (33 loc) · 949 Bytes
/
webpackDevServer.config.js
File metadata and controls
36 lines (33 loc) · 949 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
const evalSourceMapMiddleware = require("react-dev-utils/evalSourceMapMiddleware");
const ignoredFiles = require("react-dev-utils/ignoredFiles");
const redirectServedPath = require("react-dev-utils/redirectServedPathMiddleware");
const paths = require("./helpers/paths");
module.exports = {
compress: true,
static: {
directory: paths.appPublic,
publicPath: [paths.basePath],
watch: {
ignored: ignoredFiles(paths.src)
}
},
client: {
progress: true,
overlay: {
errors: true,
warnings: false
}
},
devMiddleware: {
stats: "none" // Already handled manually
},
historyApiFallback: {
disableDotRule: true, // Supports route with dots
index: paths.basePath
},
setupMiddlewares: (middlewares, devServer) => ([
...middlewares,
evalSourceMapMiddleware(devServer), // Fetches source contents from webpack for the error overlay
redirectServedPath(paths.basePath) // Redirects to `basePath` if url not match
])
};