mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 12:35:35 +02:00
Merge pull request #122 from multica-ai/fix/ui-hmr-watch
fix(desktop): restructure to standard electron-vite layout for HMR
This commit is contained in:
@@ -18,18 +18,10 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
renderer: {
|
||||
root: '.',
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
index: path.resolve(__dirname, 'index.html'),
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [react(), tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
'@': path.resolve(__dirname, 'src/renderer/src'),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -55,7 +55,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
// APP_ROOT points to apps/desktop (two levels up from out/main/)
|
||||
process.env.APP_ROOT = path.join(__dirname, '../..')
|
||||
|
||||
export const VITE_DEV_SERVER_URL = process.env['VITE_DEV_SERVER_URL']
|
||||
// electron-vite uses ELECTRON_RENDERER_URL for dev server
|
||||
export const VITE_DEV_SERVER_URL = process.env['ELECTRON_RENDERER_URL']
|
||||
// electron-vite outputs to out/ directory
|
||||
export const MAIN_DIST = path.join(__dirname)
|
||||
export const RENDERER_DIST = path.join(__dirname, '../renderer')
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
<script type="module" src="./src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,7 +15,7 @@
|
||||
"jsx": "react-jsx",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@/*": ["./src/renderer/src/*"],
|
||||
"@multica/ui/*": ["../../packages/ui/src/*"],
|
||||
"@multica/store/*": ["../../packages/store/src/*"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user