Skip to content

Commit

Permalink
run electron-reload only on dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric-giraudet committed Nov 27, 2020
1 parent ee65b92 commit eb2f043
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const { app, BrowserWindow } = require("electron");
const path = require("path");

require("electron-reload")(__dirname, {
electron: path.join(__dirname, "node_modules", ".bin", "electron"),
});
if (process.env.NODE_ENV === "development") {
require("electron-reload")(__dirname, {
electron: path.join(__dirname, "node_modules", ".bin", "electron"),
});
}

function createWindow() {
const win = new BrowserWindow({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"main": "main.js",
"scripts": {
"start": "electron-forge start",
"start": "NODE_ENV=development electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make"
},
Expand Down

0 comments on commit eb2f043

Please sign in to comment.