mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-02-07 17:00:10 +08:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
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(),
|
|
electron({
|
|
main: {
|
|
entry: 'electron-main/index.ts',
|
|
vite: {
|
|
build: {
|
|
sourcemap: false,
|
|
},
|
|
},
|
|
},
|
|
preload: {
|
|
input: {
|
|
// You can configure multiple preload here
|
|
splash: join(__dirname, 'electron-preload/splash.ts'),
|
|
},
|
|
vite: {
|
|
build: {
|
|
// For debug
|
|
sourcemap: 'inline',
|
|
}
|
|
}
|
|
},
|
|
}),
|
|
// Enable use Electron, Node.js API in Renderer-process
|
|
renderer(),
|
|
// TODO: integrate into 'vite-plugin-electron' by default
|
|
polyfillExports(),
|
|
],
|
|
build: {
|
|
// TODO: integrate into 'vite-plugin-electron' by default
|
|
emptyOutDir: false,
|
|
},
|
|
})
|