diff options
Diffstat (limited to 'packages/main/src/devTools.ts')
-rw-r--r-- | packages/main/src/devTools.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/packages/main/src/devTools.ts b/packages/main/src/devTools.ts index 6c25b3e..7c7c86a 100644 --- a/packages/main/src/devTools.ts +++ b/packages/main/src/devTools.ts | |||
@@ -27,14 +27,12 @@ import type { BrowserWindow } from 'electron'; | |||
27 | * because the mobx-state-tree devtools are currently unmaintained. | 27 | * because the mobx-state-tree devtools are currently unmaintained. |
28 | */ | 28 | */ |
29 | export async function installDevToolsExtensions(): Promise<void> { | 29 | export async function installDevToolsExtensions(): Promise<void> { |
30 | const installerPackage = await import('electron-devtools-installer'); | 30 | // Hack to lazily require a CJS module from an ES module transpiled into a CJS module. |
31 | const { | 31 | const { |
32 | default: installExtension, | 32 | default: installExtension, |
33 | REACT_DEVELOPER_TOOLS, | 33 | REACT_DEVELOPER_TOOLS, |
34 | REDUX_DEVTOOLS, | 34 | REDUX_DEVTOOLS, |
35 | } = installerPackage.default instanceof Function | 35 | } = require('electron-devtools-installer'); |
36 | ? installerPackage | ||
37 | : installerPackage.default as unknown as typeof import('electron-devtools-installer'); | ||
38 | await installExtension( | 36 | await installExtension( |
39 | [ | 37 | [ |
40 | REACT_DEVELOPER_TOOLS, | 38 | REACT_DEVELOPER_TOOLS, |