WIP attempt to wire up electron-forge

I wasn't able to get this fully working, IIRC; the challenge was getting
the webpack build for web stuff to happen reliably.
This commit is contained in:
Max Goodhart
2023-04-14 23:33:57 -07:00
committed by sayhiben
parent 00e07549d6
commit cf73dcf604
19 changed files with 4987 additions and 1180 deletions

View File

@@ -68,7 +68,7 @@ export default class StreamWindow extends EventEmitter {
const backgroundView = new BrowserView({
webPreferences: {
contextIsolation: true,
preload: path.join(app.getAppPath(), 'layerPreload.js'),
preload: BACKGROUND_PRELOAD_WEBPACK_ENTRY,
},
})
win.addBrowserView(backgroundView)
@@ -79,13 +79,13 @@ export default class StreamWindow extends EventEmitter {
height,
useContentSize: true,
})
backgroundView.webContents.loadFile('background.html')
backgroundView.webContents.loadURL(BACKGROUND_WEBPACK_ENTRY)
this.backgroundView = backgroundView
const overlayView = new BrowserView({
webPreferences: {
contextIsolation: true,
preload: path.join(app.getAppPath(), 'layerPreload.js'),
preload: OVERLAY_PRELOAD_WEBPACK_ENTRY,
},
})
win.addBrowserView(overlayView)
@@ -95,7 +95,7 @@ export default class StreamWindow extends EventEmitter {
width,
height,
})
overlayView.webContents.loadFile('overlay.html')
overlayView.webContents.loadURL(OVERLAY_WEBPACK_ENTRY)
this.overlayView = overlayView
this.viewActions = {
@@ -148,7 +148,7 @@ export default class StreamWindow extends EventEmitter {
const { backgroundColor } = this.config
const view = new BrowserView({
webPreferences: {
preload: path.join(app.getAppPath(), 'mediaPreload.js'),
preload: MEDIA_PRELOAD_WEBPACK_ENTRY,
nodeIntegration: false,
enableRemoteModule: false,
contextIsolation: true,

View File

@@ -381,7 +381,7 @@ async function main(argv) {
if (argv.control.address) {
console.debug('Initializing web server...')
const webDistPath = path.join(app.getAppPath(), 'web')
const webDistPath = path.join(app.getAppPath(), './web')
await initWebServer({
certDir: argv.cert.dir,
certProduction: argv.cert.production,