1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

clean up / optimizations

This commit is contained in:
Roman 2020-06-16 12:44:03 +03:00
parent 606d1a9198
commit 1fa523c012
3 changed files with 6 additions and 5 deletions

View File

@ -7,8 +7,8 @@
"scripts": { "scripts": {
"dev": "yarn compile:dll && concurrently yarn:dev:*", "dev": "yarn compile:dll && concurrently yarn:dev:*",
"dev-run": "electron --inspect .", "dev-run": "electron --inspect .",
"dev:main": "DEBUG=true webpack --watch --cache --config webpack.main.ts", "dev:main": "DEBUG=true webpack --watch --progress --config webpack.main.ts",
"dev:renderer": "DEBUG=true webpack --watch --cache --config webpack.renderer.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": "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:main": "NODE_ENV=production webpack --progress --config webpack.main.ts $@",
"compile:renderer": "NODE_ENV=production webpack --progress --config webpack.renderer.ts $@", "compile:renderer": "NODE_ENV=production webpack --progress --config webpack.renderer.ts $@",

View File

@ -173,7 +173,7 @@ export class ContextHandler {
} }
public applyHeaders(req: http.IncomingMessage) { 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<any>) { public async withTemporaryKubeconfig(callback: (kubeconfig: string) => Promise<any>) {
@ -188,7 +188,7 @@ export class ContextHandler {
if (!this.proxyServer) { if (!this.proxyServer) {
const proxyPort = await this.resolveProxyPort() const proxyPort = await this.resolveProxyPort()
const proxyEnv = Object.assign({}, process.env) 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 proxyEnv.HTTPS_PROXY = this.cluster.preferences.httpsProxy
} }
this.proxyServer = new KubeAuthProxy(this.cluster, proxyPort, proxyEnv) this.proxyServer = new KubeAuthProxy(this.cluster, proxyPort, proxyEnv)

View File

@ -31,7 +31,8 @@ export default function (): webpack.Configuration {
use: "node-loader" use: "node-loader"
}, },
{ {
test: /\.ts?$/, test: /\.ts$/,
exclude: /node_modules/,
use: { use: {
loader: "ts-loader", loader: "ts-loader",
options: { options: {