mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-09 05:09:39 +00:00
Fixed Linux build
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import electron from 'electron'
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const electron = require('electron')
|
||||||
import { ContextBridgeApi, IpcFromMainEmitEvents, IpcInvokeEvents, IpcToMainEmitEvents } from '../src-shared/interfaces/ipc.interface.js'
|
import { ContextBridgeApi, IpcFromMainEmitEvents, IpcInvokeEvents, IpcToMainEmitEvents } from '../src-shared/interfaces/ipc.interface.js'
|
||||||
|
|
||||||
function getInvoker<K extends keyof IpcInvokeEvents>(key: K) {
|
function getInvoker<K extends keyof IpcInvokeEvents>(key: K) {
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ import fs from 'fs'
|
|||||||
const filePath = './dist/electron/src-electron/preload.js'
|
const filePath = './dist/electron/src-electron/preload.js'
|
||||||
const newFilePath = './dist/electron/src-electron/preload.mjs'
|
const newFilePath = './dist/electron/src-electron/preload.mjs'
|
||||||
|
|
||||||
|
/** This is the dumbest hack I've ever implemented, but it works lol */
|
||||||
if (fs.existsSync(filePath)) {
|
if (fs.existsSync(filePath)) {
|
||||||
fs.renameSync(filePath, newFilePath)
|
const mjsFile = fs.readFileSync(filePath).toString('utf8')
|
||||||
|
fs.writeFileSync(newFilePath, mjsFile.replace(/export {};/, ''))
|
||||||
|
fs.rmSync(filePath)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user