aboutsummaryrefslogtreecommitdiff
path: root/packages/client/vue.config.js
blob: f35b739c39a5d0f64255e7a7acfe6671a68b8ac8 (plain)
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
const yaml = require("js-yaml");
const fs = require("fs");

const settings = yaml.load(fs.readFileSync(`${__dirname}/../../settings.yml`, "utf8"));

module.exports = {
	devServer: {
		host: settings.host,
		port: settings.dev_port,
		proxy: {
			"^/api": {
				target: `http://${settings.host}:${settings.port}`,
				changeOrigin: true
			},
			"^/[a-zA-Z0-9\\.\\-_]+/info/refs": {
				target: `http://${settings.host}:${settings.port}`,
				changeOrigin: true
			},
			"^/[a-zA-Z0-9\\.\\-_]+/git-upload-pack": {
				target: `http://${settings.host}:${settings.port}`,
				changeOrigin: true
			}
		}
	},
	chainWebpack: config => {
		config
			.plugin("html")
			.tap(args => {
				args[0].title = settings.title;
				return args;
			});
	}
};