Files
SlimeVR-Server/gui/electron.vite.config.ts
lucas lelievre a891203204 Switch to Electron (#1747)
Co-authored-by: Hannah Lindrob <hannahlindrob@ourlook.com>
Co-authored-by: Sapphire <imsapphire0@gmail.com>
2026-03-10 21:38:02 +01:00

48 lines
1.2 KiB
TypeScript

import { defineConfig } from 'electron-vite'
import { resolve } from 'path'
import rendererConfig from './vite.config' // Import your existing React config
export default defineConfig({
main: {
build: {
rollupOptions: {
input: resolve(__dirname, 'electron/main/index.ts'),
external: [
'pino',
'pino-pretty',
'pino-roll',
'commander',
'open'
]
}
}
},
preload: {
build: {
rollupOptions: {
input: resolve(__dirname, 'electron/preload/index.ts'),
output: {
format: 'cjs', // Force CJS for the preload
entryFileNames: 'index.js' // Change back to .js
}
}
}
},
renderer: {
...rendererConfig,
root: '.',
build: {
commonjsOptions: {
// Force Rollup to treat the protocol directory as CommonJS
// even though it's not in node_modules
include: [/solarxr-protocol/, /node_modules/],
// Required for Flatbuffers/Generated code interop
transformMixedEsModules: true,
},
rollupOptions: {
input: resolve(__dirname, 'index.html')
}
}
}
})