Skip to content

Commit

Permalink
disable chrome debugger in production env
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin committed Dec 13, 2015
1 parent cce5955 commit 4a3382a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ let template;
let mainWindow = null;


require('electron-debug')();
crashReporter.start();

if (process.env.NODE_ENV === 'development') {
require('electron-debug')();
}


app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
Expand Down Expand Up @@ -102,7 +105,7 @@ app.on('ready', () => {
}]
}, {
label: 'View',
submenu: [{
submenu: (process.env.NODE_ENV === 'development') ? [{
label: 'Reload',
accelerator: 'Command+R',
click() {
Expand All @@ -120,6 +123,12 @@ app.on('ready', () => {
click() {
mainWindow.toggleDevTools();
}
}] : [{
label: 'Toggle Full Screen',
accelerator: 'Ctrl+Command+F',
click() {
mainWindow.setFullScreen(!mainWindow.isFullScreen());
}
}]
}, {
label: 'Window',
Expand Down Expand Up @@ -179,7 +188,7 @@ app.on('ready', () => {
}]
}, {
label: '&View',
submenu: [{
submenu: (process.env.NODE_ENV === 'development') ? [{
label: '&Reload',
accelerator: 'Ctrl+R',
click() {
Expand All @@ -197,6 +206,12 @@ app.on('ready', () => {
click() {
mainWindow.toggleDevTools();
}
}] : [{
label: 'Toggle &Full Screen',
accelerator: 'F11',
click() {
mainWindow.setFullScreen(!mainWindow.isFullScreen());
}
}]
}, {
label: 'Help',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lint": "eslint app test *.js",
"hot-server": "node server.js",
"build": "better-npm-run build",
"start": "electron .",
"start": "NODE_ENV=production electron .",
"start-hot": "better-npm-run start-hot",
"package": "better-npm-run package",
"package-all": "npm run package -- --all",
Expand Down

0 comments on commit 4a3382a

Please sign in to comment.