mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2025-01-09 14:12:05 -05:00
only import electron-devtools-installer in dev mode
This commit is contained in:
parent
eff882c928
commit
4767897f4b
1 changed files with 7 additions and 6 deletions
|
@ -2,8 +2,6 @@ import {app, BrowserWindow} from 'electron';
|
|||
import * as path from 'path';
|
||||
import {format as formatUrl} from 'url';
|
||||
|
||||
import installExtension, {REACT_DEVELOPER_TOOLS} from 'electron-devtools-installer';
|
||||
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
|
||||
// global reference to mainWindow (necessary to prevent window from being garbage collected)
|
||||
|
@ -18,10 +16,13 @@ const createMainWindow = () => {
|
|||
|
||||
if (isDevelopment) {
|
||||
window.webContents.openDevTools();
|
||||
import('electron-devtools-installer').then(importedModule => {
|
||||
const {default: installExtension, REACT_DEVELOPER_TOOLS} = importedModule;
|
||||
installExtension(REACT_DEVELOPER_TOOLS);
|
||||
// TODO: add logging package and bring back the lines below
|
||||
// .then(name => console.log(`Added Extension: ${name}`))
|
||||
// .catch(err => console.log('An error occurred: ', err));
|
||||
});
|
||||
}
|
||||
|
||||
if (isDevelopment) {
|
||||
|
|
Loading…
Reference in a new issue