Add build flag for production UI dist output embed.

This commit is contained in:
2025-01-25 18:41:34 -07:00
parent a3ac233f39
commit 8c8ec659a9
4 changed files with 34 additions and 21 deletions

19
ui/embed.go Normal file
View File

@@ -0,0 +1,19 @@
package ui
import (
"embed"
"io/fs"
)
//go:embed dist
var embedUI embed.FS
/// GetUIFS returns an embed FS for the UI components in the dist dir.
func GetUIFS() fs.FS {
f, err := fs.Sub(embedUI, "build")
if err != nil {
panic(err)
}
return f
}