1
0
peddlers-of-ketran/webpack.dev.js
James Ketrenos d48c1a5dd6 Runs with webdev
Signed-off-by: James Ketrenos <james_gitlab@ketrenos.com>
2020-04-21 20:46:52 -07:00

39 lines
926 B
JavaScript

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:1130${base}/dist/`,
hotOnly: true,
disableHostCheck: true,
historyApiFallback: true,
proxy: proxy
},
plugins: [new webpack.HotModuleReplacementPlugin()]
});