2022-06-14 20:53:01 +08:00
|
|
|
import { join } from 'path'
|
2022-06-13 22:10:18 +08:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
2022-06-14 20:53:01 +08:00
|
|
|
import electron from 'vite-plugin-electron'
|
|
|
|
import renderer from 'vite-plugin-electron/renderer'
|
|
|
|
import polyfillExports from 'vite-plugin-electron/polyfill-exports'
|
2022-06-13 22:10:18 +08:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2022-06-14 20:53:01 +08:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
electron({
|
|
|
|
main: {
|
|
|
|
entry: 'electron-main/index.ts',
|
|
|
|
},
|
|
|
|
preload: {
|
|
|
|
input: {
|
|
|
|
// You can configure multiple preload here
|
|
|
|
p1: join(__dirname, 'electron-preload'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
// Enable use Electron, Node.js API in Renderer-process
|
|
|
|
renderer(),
|
|
|
|
// TODO: integrate into 'vite-plugin-electron' by default
|
|
|
|
polyfillExports(),
|
|
|
|
],
|
2022-06-13 22:10:18 +08:00
|
|
|
})
|