Fix path for dist

This commit is contained in:
kolaente 2020-10-10 23:15:48 +02:00
parent b3735d84a7
commit 526cfa08a6
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 2 deletions

View File

@ -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})
})