Repository navigation
Expand file tree
/
Copy pathvite.web.config.ts
More file actions
45 lines (44 loc) · 1.58 KB
/
Copy pathvite.web.config.ts
File metadata and controls
45 lines (44 loc) · 1.58 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
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import {
createRendererChunkBudgetPlugin,
createRendererWorkerChunkBudgetPlugin
} from './build-plugins/renderer-chunk-budget'
import { computeOrcaBuildInfoLiteral } from './build-plugins/orca-build-info'
export default defineConfig({
root: resolve('src/renderer'),
// Why: pairing URLs may live under a reverse-proxy path prefix like
// /orca/web-index.html, so built assets must resolve relative to the page.
base: './',
plugins: [react(), tailwindcss(), createRendererChunkBudgetPlugin('web')],
define: {
ORCA_FEATURE_WALL_ENABLED: 'true',
// Why: Settings → General renders ORCA_BUILD_INFO unconditionally. Without the
// define here it survives as a free identifier and the pane throws
// ReferenceError in the web client — the desktop config defines it, so no
// desktop test or build can see the gap.
ORCA_BUILD_INFO: computeOrcaBuildInfoLiteral()
},
resolve: {
alias: {
'@renderer': resolve('src/renderer/src'),
'@': resolve('src/renderer/src')
}
},
build: {
outDir: resolve('out/web'),
emptyOutDir: true,
// The custom policy caps both the 2 MiB entry closure and lazy files rather
// than relying on Vite's one-size-fits-all 500 kB advisory.
chunkSizeWarningLimit: 5_000,
rollupOptions: {
input: resolve('src/renderer/web-index.html')
}
},
worker: {
format: 'es',
plugins: () => [createRendererWorkerChunkBudgetPlugin()]
}
})