Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
50 lines (49 loc) · 1.88 KB
/
Copy pathvite.config.ts
File metadata and controls
50 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import { REMOTE_MANIFEST_FILE } from './src/shared/remote-console-config';
export default defineConfig({
plugins: [react()],
root: 'src/renderer',
base: './',
build: {
outDir: '../../dist/renderer',
emptyOutDir: true,
// The Remote Console (#254) serves ONLY the files in the manifest closure
// of `remote/index.html` (main/remote-console/static-assets.ts), so the
// build has to say what that closure is. Written as a plain file at the
// outDir root rather than Vite's default `.vite/manifest.json`: a dot
// directory is not guaranteed to survive electron-builder's `dist/**/*`
// glob, and a manifest that silently went
// missing from a release is a console that answers 503 `ui-not-built`.
manifest: REMOTE_MANIFEST_FILE,
// Vite 8 bundles with Rolldown; `rolldownOptions` is the current spelling
// (`rollupOptions` is the deprecated alias). Two entries: the desktop
// renderer, unchanged, and the phone console, which shares only what the
// bundler decides is common (React) and nothing of the desktop's state.
rolldownOptions: {
input: {
// `index`, not `main`: the key names the emitted chunk, and the release
// steps (CLAUDE.md) grep assets/index-*.js for the desktop bundle.
index: path.resolve(__dirname, 'src/renderer/index.html'),
remote: path.resolve(__dirname, 'src/renderer/remote/index.html'),
},
},
},
resolve: {
alias: {
'@renderer': path.resolve(__dirname, 'src/renderer'),
'@shared': path.resolve(__dirname, 'src/shared'),
},
},
server: {
port: 5199,
strictPort: false,
fs: {
allow: [
// Allow serving files from the entire project root (needed for src/shared/)
path.resolve(__dirname),
],
},
},
});