From 526cfa08a697284aed7cf4ac1b201dbabadde5c7 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 10 Oct 2020 23:15:48 +0200 Subject: [PATCH] Fix path for dist --- src/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 43485b0..b8f4edb 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,8 @@ const {app, BrowserWindow, protocol, shell} = require('electron') const path = require('path') +const frontendAssetsPath = 'frontend/' + function createWindow() { // Create the browser window. const win = new BrowserWindow({ @@ -20,8 +22,10 @@ function createWindow() { // Hide the toolbar win.setMenuBarVisibility(false) + const p = path.normalize(`${__dirname}/../${frontendAssetsPath}index.html`) + // The starting point of the app - win.loadFile('./frontend/index.html') + win.loadFile(p) } // This method will be called when Electron has finished @@ -37,7 +41,7 @@ app.whenReady().then(() => { if (url.startsWith('css/fonts') || url.startsWith('css/img')) { url = url.substr(4) } - url = path.normalize(`${root}/frontend/${url}`) + url = path.normalize(`${root}/${frontendAssetsPath}${url}`) } callback({path: url}) })