mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-05 18:01:56 +02:00
Co-authored-by: Hannah Lindrob <hannahlindrob@ourlook.com> Co-authored-by: Sapphire <imsapphire0@gmail.com>
48 lines
1.2 KiB
TypeScript
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')
|
|
}
|
|
}
|
|
}
|
|
})
|