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.
23 lines
478 B
Go
23 lines
478 B
Go
// 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
|
|
}
|