123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import {
- defineConfig,
- defineViteConfig,
- externalizeDepsPlugin,
- } from 'electron-vite';
- import { mergeConfig } from 'vite';
- import { resolve } from 'path';
- import productionConfig from './config/vite.config.prod';
- import developmentConfig from './config/vite.config.dev';
- export default defineConfig({
- main: {
- plugins: [externalizeDepsPlugin()],
- build: {
- rollupOptions: {
- input: {
- index: resolve(__dirname, 'electron/main/index.ts'),
- },
- },
- },
- },
- preload: {
- plugins: [externalizeDepsPlugin()],
- build: {
- rollupOptions: {
- input: {
- index: resolve(__dirname, 'electron/preload/index.ts'),
- },
- },
- },
- },
- renderer: defineViteConfig(({ mode }) => {
- const config = mergeConfig(
- {
- root: '.',
- build: {
- rollupOptions: {
- input: {
- index: resolve(__dirname, 'index.html'),
- },
- },
- },
- },
- mode === 'production' ? productionConfig : developmentConfig
- );
- return config;
- }),
- });
|