We have an electron app and want to load the renderer bundle using loadUrl()
.
win=new BrowserWindow({ /* ... */ })
win.loadURL(`file://${path.join(__dirname, '../../render/build/index.html')}`);
Inside the html file, we load the React Bundle
<script type="text/javascript" src="/js/app-my-hash.bundle.js"></script>
However, as expected, the file is not found, since, I guess, I need to set the root of the project somehow. I get this error
Failed to load resource: net::ERR_FILE_NOT_FOUND
What setting am I missing on the electron side (or webpack side) to get this working?