-
Notifications
You must be signed in to change notification settings - Fork 19
/
webpack.dev.js
47 lines (44 loc) · 1.61 KB
/
webpack.dev.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
const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");
module.exports = merge(common, {
mode: "development",
devtool: "eval-source-map",
devServer: {
devMiddleware: {
publicPath: "/",
index: "slycat_projects.html",
},
// Only compiles on refresh, not on file change. But does not work, complains of running webpack twice.
// lazy: true,
// Disable live reloading. Useful when trying to run two branches side by side.
// inline: false,
// compress: true,
host: "0.0.0.0",
port: 9000,
server: "https",
proxy: [
{
context: ["/api"],
target: "https://haproxy:443",
pathRewrite: { "^/api": "" },
secure: false,
},
],
historyApiFallback: {
rewrites: [
// { from: /^\/$/, to: '/views/landing.html' },
// { from: /^\/subpage/, to: '/views/subpage.html' },
// If the URL begins with projects/ (note the trailing slash), serve up the single project page
{ from: /^\/projects\//, to: "/slycat_project.html" },
// If the URL begins with projects (note no trailing slash), serve up the listing of all projects.
// This is for backwards compatibility, since we used to redirect unknown URLs to /projects to give the user
// a projects listing.
{ from: /^\/projects/, to: "/slycat_projects.html" },
{ from: /^\/models/, to: "/slycat_model.html" },
{ from: /^\/login/, to: "/slycat_login.html" },
{ from: /^\/pages/, to: "/slycat_page.html" },
// { from: /./, to: '/views/404.html' },
],
},
},
});