Archived
1
0

Handle when VS Code fails to load

This is mostly for development where VS Code might not have finished
compiling yet.
This commit is contained in:
Asher
2020-02-05 14:21:59 -06:00
parent 7c6fe56043
commit 6e809b6a31
9 changed files with 205 additions and 183 deletions

View File

@ -19,7 +19,7 @@ export class MainHttpProvider extends HttpProvider {
): Promise<HttpResponse | undefined> {
if (base === "/static") {
const response = await this.getResource(this.rootPath, requestPath)
if (this.options.commit && this.options.commit !== "development") {
if (!this.isDev) {
response.cache = true
}
return response
@ -41,7 +41,7 @@ export class MainHttpProvider extends HttpProvider {
const response = await this.getUtf8Resource(this.rootPath, "src/browser/index.html")
response.content = response.content
.replace(/{{COMMIT}}/g, this.options.commit || "development")
.replace(/{{COMMIT}}/g, this.options.commit)
.replace(/"{{OPTIONS}}"/g, `'${JSON.stringify(options)}'`)
.replace(/{{COMPONENT}}/g, ReactDOMServer.renderToString(<App options={options} />))
return response