Wow thanks to Subu suggesting a JS beautifier I found it pretty quick. I used os.walk python to look in every file for "useProxy" and add any that contained it to a list. Then I just beautified the code in those few files before searching through them. In '\server\rest\apps.js' there is a function called zipApp which does what I expected, edits the app config in the deployment zip. I dont know enough JS to tell if it happens before or after zipping but I plugged 'TEST' into the empty url string, saved, exported and there it is in the config.json in the zipfile. Beautified version below, the url is on line 21.
function zipApp(e, t) {
var n = getAppPath(e);
n = path.normalize(n);
try {
fs.existsSync("./apps/zips") || fs.mkdirSync("./apps/zips");
var i = fse.readJsonSync(path.join(getAppPath(e), "config.json")),
r = i.portalUrl;
"/" !== r.substr(r.length - 1, r.length) && (r += "/");
var o = new JSZip;
utils.visitFolderFiles(n, function(e, t, i) {
var r, a = e.substr(n.length, e.length);
if (i) o.folder(a);
else if ("env.js" === a) r = fs.readFileSync(e, {
encoding: "utf-8"
}), r = r.replace("//apiUrl = ", "apiUrl = "), o.file(a, r);
else if ("config.json" === a) {
var p = fse.readJsonSync(e);
p.httpProxy = {
useProxy: !0,
alwaysUseProxy: !1,
url: "",
rules: []
}, p.appId = "", o.file(a, JSON.stringify(p))
} else r = fs.readFileSync(e), o.file(a, r)
});
var a = o.generate({
type: "nodebuffer",
compression: "DEFLATE"
});
fs.writeFileSync(getZipFilePath(e), a, "binary"), t()
} catch (p) {
console.log(p), t(p)
}
}