i`ve a problem with electron-builder and the browserWindows preload option in my main.js:
// Create the browser window.
mainWindow = new BrowserWindow({
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
minHeight: 500,
minWidth: 1000,
icon: path.join(__dirname, 'icon.ico'),
frame: false,
webPreferences: {
preload: path.resolve(__dirname, 'preload.js'), // <--- PROBLEM
nativeWindowOpen: true,
spellcheck: true,
nodeIntegration: false
}
});
after starting the packaged app i get the following error:
Unable to load preload script: C:\Users[...]\resources\app.asar\preload.js
The preload.js is in the same directory as the main.js.
Any ideas to solve this problem?
with kind regards, kai W.
electron-builder
configuration – Anthemionpreload.js
, which appeared underUnable to load preload script
– Hasin