2.1 KiB
2.1 KiB
description
| description |
|---|
| Frontends build with vp build in Vite app mode, keeping the exact output paths the Rust backend and HTML expect; emptyOutDir false when outDir holds committed files |
deno bundle was replaced by vp build in Vite app mode (not
build.lib). Behavior must not change, so the output keeps the file names and
locations the backend serves and the HTML references.
Typical shape for the Rust-backed frontends (home, eximium, stockvibe,
memona-home), where frontend/ builds into backend/static:
build: {
outDir: "../backend/static",
emptyOutDir: false, // the folder holds committed files (index.html, ...)
rollupOptions: {
input: { bundle: "src/index.ts" },
output: { entryFileNames: "js/[name].js" }, // -> js/bundle.js
},
},
- Fixed names, no hashes: set
entryFileNames(andassetFileNameswhere assets are emitted) explicitly. Vite's hashed defaults would 404, since Rust and the templates requestjs/bundle.jsandcss/theme.css. emptyOutDir: falsewheneveroutDiris outside the Vite root or holds committed files. Never let it default to true there: it would wipe them.- Output stays gitignored, so
.gitignore,.containerignore, and the Rust side need no edits; home's startup check forjs/bundle.jsandcss/theme.csskeeps passing. - CSS is never imported from TS (no
import "./theme.css"); the HTML links the stylesheet. How the CSS file is produced is per repo; read the repo'svite.config.tsbefore changing it. - Copy whole
js/andcss/directories in Containerfiles, not single files, so code-split chunks ship too (app-containers-and-ci). - Where a repo serves an
index.htmlentry (brain's dashboard), use plain app mode withindex.htmlas input,baseset to the mount path, andoutDir: "dist"with the defaultemptyOutDir. vp devmust work too, and the decorators plugin must cover build, dev, and test (decorators-standard-accessor).
Check the repo's own migration PR for its final values before editing; these are the conventions it followed, not a config to paste.