import { PluginOption } from 'vite'
import VitePluginELectron from 'vite-use-electron'

const useElectronPlugin: () => PluginOption = () =>
  VitePluginELectron({
    main: {
      entry: 'electron/main/main',
      publicDir: 'electron/main/public',
      build: { outDir: 'dist/electron/main', emptyOutDir: true },
    },
    preload: {
      entry: 'electron/preload/preload',
      publicDir: 'electron/preload/public',
      build: { outDir: 'dist/electron/preload', emptyOutDir: true },
    },
  })

export default useElectronPlugin
