fix preload script paths

This commit is contained in:
Anton Bracke 2022-02-18 23:49:36 +01:00
parent 313366d5b1
commit 2c0cb2f62b
No known key found for this signature in database
GPG Key ID: B1222603899C6B25

View File

@ -36,7 +36,7 @@ export function createWindow() {
autoHideMenuBar: true, autoHideMenuBar: true,
show: false, show: false,
webPreferences: { webPreferences: {
preload: path.join(__dirname, "../dist/sidebar/preload.js"), preload: path.resolve(__dirname, "..", "build", "sidebar", "preload.js"),
}, },
}); });
@ -69,7 +69,7 @@ export function createWindow() {
appView = new BrowserView({ appView = new BrowserView({
webPreferences: { webPreferences: {
preload: path.join(__dirname, "../dist/app/index.js"), preload: path.resolve(__dirname, "..", "build", "app", "preload.js"),
}, },
}); });
mainWindow.setBrowserView(appView); mainWindow.setBrowserView(appView);
@ -87,8 +87,8 @@ export function createWindow() {
mainWindow.once("ready-to-show", () => { mainWindow.once("ready-to-show", () => {
(async () => { (async () => {
await appView?.webContents.loadURL("https://workadventu.re/"); // TODO: use some splashscreen ? await appView?.webContents.loadURL("https://workadventu.re/"); // TODO: use some splashscreen ?
// appView.webContents.openDevTools({ // appView?.webContents.openDevTools({
// mode: "detach", // mode: "detach",
// }); // });
mainWindow?.show(); mainWindow?.show();
// mainWindow?.webContents.openDevTools({ mode: "detach" }); // mainWindow?.webContents.openDevTools({ mode: "detach" });