Runs with webdev
Signed-off-by: James Ketrenos <james_gitlab@ketrenos.com>
This commit is contained in:
parent
5a16804a7e
commit
d48c1a5dd6
@ -2,17 +2,37 @@ const path = require("path");
|
|||||||
const merge = require('webpack-merge')
|
const merge = require('webpack-merge')
|
||||||
const common = require('./webpack.common.js');
|
const common = require('./webpack.common.js');
|
||||||
const webpack = require('webpack');
|
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, {
|
module.exports = merge(common, {
|
||||||
mode: "development",
|
mode: "development",
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: path.join(__dirname, "/"),
|
contentBase: path.join(__dirname, "/"),
|
||||||
port: 1130,
|
port: 1130,
|
||||||
publicPath: "http://localhost:8911/dist/",
|
publicPath: `http://localhost:1130${base}/dist/`,
|
||||||
hotOnly: true,
|
hotOnly: true,
|
||||||
disableHostCheck: true,
|
disableHostCheck: true,
|
||||||
historyApiFallback: true
|
historyApiFallback: true,
|
||||||
|
proxy: proxy
|
||||||
},
|
},
|
||||||
plugins: [new webpack.HotModuleReplacementPlugin()]
|
plugins: [new webpack.HotModuleReplacementPlugin()]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user