mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +08:00
feat: configure vite-plugin-electron
This commit is contained in:
parent
6fe969ffcb
commit
c9188fd2f9
@ -1,7 +1,28 @@
|
||||
import { join } from 'path'
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import electron from 'vite-plugin-electron'
|
||||
import renderer from 'vite-plugin-electron/renderer'
|
||||
import polyfillExports from 'vite-plugin-electron/polyfill-exports'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()]
|
||||
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(),
|
||||
],
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user