Add build flag for production UI dist output embed.
This commit is contained in:
19
ui/embed.go
Normal file
19
ui/embed.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user