Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions desktop/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,37 @@ export default defineConfig({
outDir: "dist",
emptyOutDir: true,
target: "es2021",
// Use terser for smaller output (esbuild is faster to build but produces
// larger bundles). Disabled for dev builds via the default.
minify: "terser",
terserOptions: {
compress: {
drop_console: true, // strip console.log in production
passes: 2, // two compression passes for better tree-shaking
},
},
rollupOptions: {
output: {
// Manual chunk splitting: keep the heavy markdown/math/code pipeline
// in a separate chunk so it can be cached independently from the
// app shell. The vendor chunk splits react+react-dom (stable, rarely
// changes) from the markdown stack (changes more often).
manualChunks: {
"vendor-react": ["react", "react-dom"],
"vendor-markdown": [
"react-markdown",
"remark-gfm",
"remark-math",
"rehype-katex",
"katex",
],
"vendor-highlight": ["highlight.js"],
},
},
},
// Raise the warning limit — the markdown vendor chunk is legitimately large
// (katex alone is ~300KB). The manual split ensures it's cached separately.
chunkSizeWarningLimit: 600,
},
server: {
// Bind IPv4 — unset host listens on ::1, and the Wails dev proxy's [::1]
Expand Down
Loading