Rebuild the admin dashboard as a Svelte 5 + TypeScript app
Frontend in web/ (Vite via bun, pure CSS, no component libraries), built to internal/dashboard/dist and embedded into the binary; the Dockerfile builds it in a bun stage. Old static dashboard.html removed.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Package dashboard embeds the built Svelte admin dashboard from web/.
|
||||
package dashboard
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
// dist holds the built frontend. A committed .gitkeep keeps the embed
|
||||
// pattern valid in checkouts where `bun run build` has not run yet.
|
||||
//
|
||||
//go:embed all:dist
|
||||
var files embed.FS
|
||||
|
||||
// FS returns the dashboard files rooted at the build output directory.
|
||||
func FS() fs.FS {
|
||||
sub, err := fs.Sub(files, "dist")
|
||||
if err != nil {
|
||||
return files
|
||||
}
|
||||
return sub
|
||||
}
|
||||
Reference in New Issue
Block a user