1
0

Runs with webdev

Signed-off-by: James Ketrenos <james_gitlab@ketrenos.com>
This commit is contained in:
James Ketrenos 2020-04-21 20:46:52 -07:00
parent 5a16804a7e
commit d48c1a5dd6

View File

@ -2,17 +2,37 @@ const path = require("path");
const merge = require('webpack-merge')
const common = require('./webpack.common.js');
const webpack = require('webpack');
const config = require("config");
const base = config.get("basePath");
const proxy = {
// "/photos/api/*": "http://localhost:8123/",
}
proxy[`${base}/`] = {
target: "http://localhost:8911",
bypass: function(req, res, proxyOptions) {
console.log(req.url);
if (req.url.match(new RegExp(base.replace(/\//g, "\\/") + "\/identities[/?]?"))) {
return 'index.html';
} else {
return null;
}
}
};
module.exports = merge(common, {
mode: "development",
devServer: {
contentBase: path.join(__dirname, "/"),
port: 1130,
publicPath: "http://localhost:8911/dist/",
publicPath: `http://localhost:1130${base}/dist/`,
hotOnly: true,
disableHostCheck: true,
historyApiFallback: true
historyApiFallback: true,
proxy: proxy
},
plugins: [new webpack.HotModuleReplacementPlugin()]
});