Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { resolve } from 'node:path'
|
||||
import { defineConfig } from 'electron-vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// Три независимые сборки: main (Node), preload (sandbox) и renderer (браузер).
|
||||
export default defineConfig({
|
||||
main: {
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: { index: resolve('src/main/index.ts') }
|
||||
}
|
||||
}
|
||||
},
|
||||
preload: {
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: { index: resolve('src/preload/index.ts') },
|
||||
// preload запускается в sandbox: всё, кроме самого electron, должно быть
|
||||
// вкомпилировано в бандл — require() там недоступен.
|
||||
external: ['electron']
|
||||
}
|
||||
}
|
||||
},
|
||||
renderer: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@renderer': resolve('src/renderer/src'),
|
||||
'@shared': resolve('src/shared')
|
||||
}
|
||||
},
|
||||
plugins: [react()]
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user