Electron-93 - Moved the node env const to misc

This commit is contained in:
Kiran Niranjan
2017-07-10 13:09:10 +05:30
committed by Kiran Niranjan
parent 654441ce8c
commit aec84b823b
3 changed files with 10 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ const eventEmitter = require('./eventEmitter');
const throttle = require('./utils/throttle.js');
const { getConfigField, updateConfigField } = require('./config.js');
const { isNodeEnv } = require('./utils/misc');
//context menu
const contextMenu = require('./menus/contextMenu.js');
@@ -80,8 +81,8 @@ function doCreateMainWindow(initialUrl, initialBounds) {
minHeight: MIN_HEIGHT,
alwaysOnTop: false,
webPreferences: {
sandbox: !process.env.NODE_ENV,
nodeIntegration: process.env.NODE_ENV,
sandbox: !isNodeEnv,
nodeIntegration: isNodeEnv,
preload: preloadMainScript,
}
};