electron script

This commit is contained in:
Martin McKeaveney 2020-05-15 18:13:18 +01:00
parent 03c5aaa0cb
commit 3e0381b524
2 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,7 @@
"budi": "node ../cli/bin/budi", "budi": "node ../cli/bin/budi",
"dev:builder": "nodemon ../cli/bin/budi run", "dev:builder": "nodemon ../cli/bin/budi run",
"electron": "electron src/electron.js", "electron": "electron src/electron.js",
"build:electron": "electron-builder", "build:electron": "electron-builder --dir",
"publish:electron": "electron-builder -mwl --publish always", "publish:electron": "electron-builder -mwl --publish always",
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"lint": "eslint --fix src/" "lint": "eslint --fix src/"

View File

@ -11,11 +11,14 @@ require("dotenv").config({ path: join(homedir(), ".budibase", ".env") });
const APP_URL = "http://localhost:4001/_builder"; const APP_URL = "http://localhost:4001/_builder";
const APP_TITLE = "Budibase Builder"; const APP_TITLE = "Budibase Builder";
let win;
function createWindow() { function createWindow() {
app.server = require("./app"); app.server = require("./app");
let win = new BrowserWindow({ width: 1920, height: 1080 }); win = new BrowserWindow({ width: 1920, height: 1080 });
win.setTitle(APP_TITLE); win.setTitle(APP_TITLE);
win.loadURL(APP_URL); win.loadURL(APP_URL);
win.showInactive();
if (isDev) { if (isDev) {
win.webContents.openDevTools(); win.webContents.openDevTools();
} else { } else {