Add React Developers Tools (#1410)

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
Panu Horsmalahti authored and GitHub committed 2020-11-24 12:45:12 +02:00
1 parent 37b80a9354
commit 2a8cfe5e67
4 files changed
+72 -1

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
/**
* Installs Electron developer tools in the development build.
* The dependency is not bundled to the production build.
*/
export const installDeveloperTools = async () => {
if (process.env.NODE_ENV === 'development') {
const { default: devToolsInstaller, REACT_DEVELOPER_TOOLS } = await import('electron-devtools-installer');
return devToolsInstaller([REACT_DEVELOPER_TOOLS]);
}
};
+3
View File
@@ -24,6 +24,7 @@ import { extensionLoader } from "../extensions/extension-loader";
import { extensionsStore } from "../extensions/extensions-store";
import { InstalledExtension, extensionDiscovery } from "../extensions/extension-discovery";
import type { LensExtensionId } from "../extensions/lens-extension";
import { installDeveloperTools } from "./developer-tools";
const workingDir = path.join(app.getPath("appData"), appName);
let proxyPort: number;
@@ -50,6 +51,8 @@ app.on("ready", async () => {
registerFileProtocol("static", __static);
await installDeveloperTools();
// preload
await Promise.all([
userStore.load(),