- Move renderer files to src/renderer/src/ (electron-vite standard) - Move index.html to src/renderer/ - Remove root: '.' config that broke HMR - Use ELECTRON_RENDERER_URL instead of VITE_DEV_SERVER_URL - Update tsconfig paths for new structure This fixes hot module replacement not working after the monorepo restructure. The previous non-standard directory layout with root: '.' caused electron-vite's HMR to fail silently. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
597 B
TypeScript
28 lines
597 B
TypeScript
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
|
|
import path from 'node:path'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
export default defineConfig({
|
|
main: {
|
|
plugins: [externalizeDepsPlugin()],
|
|
},
|
|
preload: {
|
|
plugins: [externalizeDepsPlugin()],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
format: 'cjs',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
renderer: {
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src/renderer/src'),
|
|
},
|
|
},
|
|
},
|
|
})
|