#Struggling to use loadURL correctly after starting to use webpack + electron forge

1 messages · Page 1 of 1 (latest)

obsidian compass
#

I was previously doing:

        workerWindow.loadURL(`file://${__dirname}/../worker.html?id=${i}`);

But this no longer appears to work now I'm also using webpack.

I get

Not allowed to load local resource:

I'd like to use loadURL in a way which will work both during testing and production.

Any pointers would be most appreciated!

vague cairn
#

webpack?

obsidian compass
#

yeah, i'm using webpack + electron forge

#

to load the main window i do - mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY); but can't work out how to make it so that worker.html is either loaded via the webpack http server in development and without it, in production

obsidian compass
#

I assume there's a way to solve this without using an 'if' statement that determines if running in development / production?