Move login page to browser directory

Fixes it not being included in the optimized build as well as making it
more consistent.
This commit is contained in:
Asher 2019-10-21 14:54:32 -05:00
parent 76f6ff4145
commit ece840834d
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
4 changed files with 4 additions and 3 deletions

View File

@ -261,7 +261,7 @@ class Builder {
fs.remove(path.join(finalServerPath, "node_modules")).then(() => {
return fs.copy(path.join(serverPath, "node_modules"), path.join(finalServerPath, "node_modules"));
}),
fs.copy(path.join(serverPath, "src/browser/workbench-build.html"), path.join(finalServerPath, "src/browser/workbench.html")),
fs.copy(path.join(finalServerPath, "src/browser/workbench-build.html"), path.join(finalServerPath, "src/browser/workbench.html")),
]);
}),
]);

View File

@ -24,6 +24,7 @@ const vscodeResources = [
"out-build/vs/server/src/node/uriTransformer.js",
"!out-build/vs/server/doc/**",
"out-build/vs/code/browser/workbench/**",
"out-build/vs/server/src/browser/*.html",
"out-build/vs/server/src/media/*",
"out-build/vs/workbench/services/extensions/worker/extensionHostWorkerMain.js",
"out-build/bootstrap.js",

View File

@ -375,7 +375,7 @@ export abstract class Server {
}
private async getLogin(error: string = "", payload?: LoginPayload): Promise<Response> {
const filePath = path.join(this.serverRoot, "login/index.html");
const filePath = path.join(this.serverRoot, "browser/login.html");
const content = (await util.promisify(fs.readFile)(filePath, "utf8"))
.replace("{{ERROR}}", error)
.replace("display:none", error ? "display:block" : "display:none")
@ -536,7 +536,7 @@ export class MainServer extends Server {
}
private async getRoot(request: http.IncomingMessage, parsedUrl: url.UrlWithParsedQuery): Promise<Response> {
const filePath = path.join(this.rootPath, "out/vs/server/src/browser/workbench.html");
const filePath = path.join(this.serverRoot, "browser/workbench.html");
let [content, startPath] = await Promise.all([
util.promisify(fs.readFile)(filePath, "utf8"),
this.getFirstValidPath([