Skip to content

Commit

Permalink
DevTools only shown when explicitly in development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
HilliamT committed Jan 1, 2021
1 parent 899f0bf commit e06c2ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"watch:electron": "tsc --watch",
"watch:react": "webpack --config webpack.common.js --watch",
"watch": "concurrently \"npm run watch:react\" \"npm run bootup\"",
"start": "export NODE_ENV=production&& npm run build && electron .",
"start": "export NODE_ENV=development&& npm run build && electron .",
"pre-commit": "npm run lint && npm run build",
"generate-icons": "mkdir -p icons/ && icon-gen -i ./icon.svg -o icons/ --icns --icns-name icon --ico --ico-name icon --favicon",
"package": "export NODE_ENV=production&& electron-builder --dir",
"make:macosx": "export NODE_ENV=production&& electron-builder -m",
"make:linux": "export NODE_ENV=production&& electron-builder -l",
"make:windows": "set NODE_ENV=production&& electron-builder -w",
"package": "electron-builder --dir",
"make:macosx": "electron-builder -m",
"make:linux": "electron-builder -l",
"make:windows": "electron-builder -w",
"make": "npm run make:macosx && npm run make:linux && npm run make:windows"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function _createWindow(): void {
// Load the index.html of the app
mainWindow.loadFile(path.join(__dirname, "../index.html"));

// Open the DevTools when not in production.
if (process.env.NODE_ENV != "production") mainWindow.webContents.openDevTools();
// Open the DevTools when in development.
if (process.env.NODE_ENV == "development") mainWindow.webContents.openDevTools();
}

// Event is shot when Electron is "ready" to create browser windows
Expand Down

0 comments on commit e06c2ba

Please sign in to comment.