From 5bef64ae5eee9ddac20fa9d4e0e9219004fa7fea Mon Sep 17 00:00:00 2001 From: cv <34649812+cpvalente@users.noreply.github.com> Date: Thu, 3 Jun 2021 14:24:35 +0200 Subject: [PATCH] win import path --- server/main.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/server/main.js b/server/main.js index b84782e53..3735a97d9 100644 --- a/server/main.js +++ b/server/main.js @@ -11,7 +11,9 @@ const { electron } = require('process'); var env = process.env.NODE_ENV || 'prod'; -const { nodeapp } = import(path.join(__dirname, env=='prod' ? '../' : '', 'src/app.js')); +const { nodeapp } = import( + path.join('file:///', __dirname, env == 'prod' ? '../' : '', 'src/app.js') +); // Load Icons // TODO: Icons appear pixelated @@ -65,18 +67,9 @@ function createWindow() { win.setMenu(null); // Load page served by node - try { - // loaded = path.join(__dirname, '../client/build/index.html'); - // win.loadURL(`file://${loaded}`); - win.loadURL('http://localhost:4001/editor'); - //win.loadURL(`file://${__dirname}/dist/index.html`); - } catch (error) { - loaded = error; - } - - // win.loadURL('http://localhost:4001/editor').then(() => { - // win.webContents.setBackgroundThrottling(false); - // }); + win.loadURL('http://localhost:4001/editor').then(() => { + win.webContents.setBackgroundThrottling(false); + }); // Show dev tools win.webContents.openDevTools({ mode: 'detach' });