diff --git a/.babelrc b/.babelrc index c2afdea6db..f781754179 100644 --- a/.babelrc +++ b/.babelrc @@ -1,14 +1,8 @@ { "presets": [ - [ - "@babel/preset-env", - { - "modules": "commonjs", - "targets": { - "esmodules": false - } - } - ], + ["@babel/preset-env", { + "modules": "commonjs" + }], "@babel/preset-react", "@lingui/babel-preset-react" ], @@ -18,7 +12,6 @@ [ "@babel/plugin-transform-runtime", { - "absoluteRuntime": false, "regenerator": true, "useESModules": true } diff --git a/package.json b/package.json index 8b4c6de551..84f43abd5c 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,15 @@ "version": "3.5.0-beta.1", "main": "dist/main.js", "scripts": { - "dev": "concurrently yarn:dev:*", + "dev": "concurrently 'yarn dev:main' 'yarn dev:renderer'", "dev-run": "electron --inspect .", - "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' && 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 $@", + "dev:main": "DEBUG=true yarn compile:main --watch $@", + "dev:renderer": "DEBUG=true yarn compile:renderer --watch $@", + "dev:react": "yarn dev:renderer --config-name react", + "dev:vue": "yarn dev:renderer --config-name vue", + "compile": "yarn download-bins && concurrently 'yarn i18n:compile' 'yarn compile:main -p' 'yarn compile:renderer -p'", + "compile:main": "webpack --progress --config webpack.main.ts $@", + "compile:renderer": "webpack --progress --config webpack.renderer.ts $@", "compile:dll": "webpack --config webpack.dll.ts $@", "build:linux": "yarn compile && electron-builder --linux --dir -c.productName=LensDev", "build:mac": "yarn compile && electron-builder --mac --dir -c.productName=LensDev", diff --git a/src/main/kube-auth-proxy.ts b/src/main/kube-auth-proxy.ts index ea1eb4b9bf..51ac06db85 100644 --- a/src/main/kube-auth-proxy.ts +++ b/src/main/kube-auth-proxy.ts @@ -7,7 +7,6 @@ import { readFileSync, watch } from "fs" import { PromiseIpc } from "electron-promise-ipc" import { findMainWebContents } from "./webcontents" import * as url from "url" -import { apiPrefix } from "../common/vars"; export class KubeAuthProxy { public lastError: string diff --git a/src/main/menu.ts b/src/main/menu.ts index f38486c849..a6dad9d54d 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -155,6 +155,7 @@ export default function initMenu(opts: MenuOptions, promiseIpc: any) { ...(isDevelopment ? [ { role: 'toggleDevTools' } as MenuItemConstructorOptions, { + accelerator: "CmdOrCtrl+Shift+I", label: 'Open Dashboard Devtools', click() { webContents.getFocusedWebContents().openDevTools() diff --git a/src/renderer/config.store.ts b/src/renderer/config.store.ts index 4ea90d1514..f1fd1874aa 100755 --- a/src/renderer/config.store.ts +++ b/src/renderer/config.store.ts @@ -1,7 +1,8 @@ -import { observable, when } from "mobx"; import type { IConfigRoutePayload } from "../main/routes/config"; + +import { observable, when } from "mobx"; import { autobind, interval } from "./utils"; -import { configApi } from "./api/endpoints"; +import { configApi } from "./api/endpoints/config.api"; @autobind() export class ConfigStore { diff --git a/webpack.renderer.ts b/webpack.renderer.ts index 7f97288aa0..9704b02023 100755 --- a/webpack.renderer.ts +++ b/webpack.renderer.ts @@ -15,8 +15,9 @@ export default [ export function webpackConfigReact(): webpack.Configuration { return { context: __dirname, + name: "react", target: "web", - devtool: isProduction ? "source-map" : "cheap-eval-source-map", + devtool: "source-map", // todo: optimize in dev-mode with webpack.SourceMapDevToolPlugin mode: isProduction ? "production" : "development", cache: isDevelopment, entry: { @@ -66,6 +67,7 @@ export function webpackConfigReact(): webpack.Configuration { // https://lingui.js.org/guides/typescript.html jsx: "preserve", target: "es2016", + module: "esnext", }, } } @@ -138,6 +140,7 @@ export function webpackConfigReact(): webpack.Configuration { export function webpackConfigVue(): webpack.Configuration { const config = webpackConfigReact(); + config.name = "vue" config.target = "electron-renderer"; config.resolve.extensions.push(".vue");