From 1fa523c012b006b481d33929b83dcb11424ccc8a Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 16 Jun 2020 12:44:03 +0300 Subject: [PATCH] clean up / optimizations --- package.json | 4 ++-- src/main/context-handler.ts | 4 ++-- webpack.main.ts | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 75fb432faf..e9eaf928ff 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "scripts": { "dev": "yarn compile:dll && concurrently yarn:dev:*", "dev-run": "electron --inspect .", - "dev:main": "DEBUG=true webpack --watch --cache --config webpack.main.ts", - "dev:renderer": "DEBUG=true webpack --watch --cache --config webpack.renderer.ts", + "dev:main": "DEBUG=true webpack --watch --progress --config webpack.main.ts", + "dev:renderer": "DEBUG=true webpack --watch --progress --config webpack.renderer.ts", "compile": "NODE_ENV=production concurrently 'yarn download-bins' 'yarn i18n:compile' 'yarn compile:dll' && concurrently yarn:compile:*", "compile:main": "NODE_ENV=production webpack --progress --config webpack.main.ts $@", "compile:renderer": "NODE_ENV=production webpack --progress --config webpack.renderer.ts $@", diff --git a/src/main/context-handler.ts b/src/main/context-handler.ts index cd9c446eff..137d45cb0f 100644 --- a/src/main/context-handler.ts +++ b/src/main/context-handler.ts @@ -173,7 +173,7 @@ export class ContextHandler { } public applyHeaders(req: http.IncomingMessage) { - req.headers["authorization"] = `Bearer ${this.id}` // Q: how it works when id == cluster.id ? + req.headers["authorization"] = `Bearer ${this.id}` } public async withTemporaryKubeconfig(callback: (kubeconfig: string) => Promise) { @@ -188,7 +188,7 @@ export class ContextHandler { if (!this.proxyServer) { const proxyPort = await this.resolveProxyPort() const proxyEnv = Object.assign({}, process.env) - if (this.cluster.preferences && this.cluster.preferences.httpsProxy) { + if (this.cluster?.preferences.httpsProxy) { proxyEnv.HTTPS_PROXY = this.cluster.preferences.httpsProxy } this.proxyServer = new KubeAuthProxy(this.cluster, proxyPort, proxyEnv) diff --git a/webpack.main.ts b/webpack.main.ts index 4b72e05a00..09c62f5dce 100755 --- a/webpack.main.ts +++ b/webpack.main.ts @@ -31,7 +31,8 @@ export default function (): webpack.Configuration { use: "node-loader" }, { - test: /\.ts?$/, + test: /\.ts$/, + exclude: /node_modules/, use: { loader: "ts-loader", options: {