2022-06-15 21:47:33 +08:00
|
|
|
import { rmSync } from 'fs'
|
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'
|
2022-06-25 10:47:53 +08:00
|
|
|
import electronConfig, { useNodeJsInElectronRenderer } from './vite.config.electron'
|
2022-06-13 22:10:18 +08:00
|
|
|
|
2022-06-15 21:47:33 +08:00
|
|
|
rmSync('dist', { recursive: true, force: true }) // v14.14.0
|
|
|
|
|
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(),
|
2022-06-25 08:47:37 +08:00
|
|
|
electron(electronConfig),
|
2022-06-14 20:53:01 +08:00
|
|
|
// Enable use Electron, Node.js API in Renderer-process
|
|
|
|
renderer(),
|
2022-06-25 10:47:53 +08:00
|
|
|
useNodeJsInElectronRenderer(),
|
2022-06-14 20:53:01 +08:00
|
|
|
],
|
2022-06-13 22:10:18 +08:00
|
|
|
})
|