12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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 }) => {
- console.log(mode);
- const config = mergeConfig(
- {
- root: '.',
- build: {
- rollupOptions: {
- input: {
- index: resolve(__dirname, 'index.html'),
- },
- },
- },
- },
- mode === 'production' ? productionConfig : developmentConfig
- );
- console.log(config);
- return config;
- }),
- });
|