diff options
Diffstat (limited to 'packages/main/src/devTools.ts')
-rw-r--r-- | packages/main/src/devTools.ts | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/packages/main/src/devTools.ts b/packages/main/src/devTools.ts index 4ca1bf3..10f4545 100644 --- a/packages/main/src/devTools.ts +++ b/packages/main/src/devTools.ts | |||
@@ -35,13 +35,28 @@ export const DEVMODE_ALLOWED_URL_PREFIXES = [ | |||
35 | ]; | 35 | ]; |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * Enables using source maps for node stack traces. | ||
39 | */ | ||
40 | export function enableStacktraceSourceMaps(): void { | ||
41 | const sourceMapSupport = | ||
42 | /* eslint-disable-next-line | ||
43 | import/no-extraneous-dependencies, | ||
44 | global-require, | ||
45 | @typescript-eslint/no-var-requires, | ||
46 | unicorn/prefer-module -- | ||
47 | Hack to lazily require a CJS module from an ES module transpiled into a CJS module. | ||
48 | */ | ||
49 | require('source-map-support') as typeof import('source-map-support'); | ||
50 | sourceMapSupport.install(); | ||
51 | } | ||
52 | |||
53 | /** | ||
38 | * Installs the react and redux developer tools extensions. | 54 | * Installs the react and redux developer tools extensions. |
39 | * | 55 | * |
40 | * We use the redux devtools and connect the mobx store to it with `mst-middlewares`, | 56 | * We use the redux devtools and connect the mobx store to it with `mst-middlewares`, |
41 | * because the mobx-state-tree devtools are currently unmaintained. | 57 | * because the mobx-state-tree devtools are currently unmaintained. |
42 | */ | 58 | */ |
43 | export async function installDevToolsExtensions(): Promise<void> { | 59 | export async function installDevToolsExtensions(): Promise<void> { |
44 | // Hack to lazily require a CJS module from an ES module transpiled into a CJS module. | ||
45 | const { | 60 | const { |
46 | default: installExtension, | 61 | default: installExtension, |
47 | REACT_DEVELOPER_TOOLS, | 62 | REACT_DEVELOPER_TOOLS, |
@@ -50,7 +65,8 @@ export async function installDevToolsExtensions(): Promise<void> { | |||
50 | import/no-extraneous-dependencies, | 65 | import/no-extraneous-dependencies, |
51 | global-require, | 66 | global-require, |
52 | @typescript-eslint/no-var-requires, | 67 | @typescript-eslint/no-var-requires, |
53 | unicorn/prefer-module | 68 | unicorn/prefer-module -- |
69 | Hack to lazily require a CJS module from an ES module transpiled into a CJS module. | ||
54 | */ | 70 | */ |
55 | } = require('electron-devtools-installer') as typeof import('electron-devtools-installer'); | 71 | } = require('electron-devtools-installer') as typeof import('electron-devtools-installer'); |
56 | await installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS], { | 72 | await installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS], { |