package frontend import ( "embed" "io/fs" ) // dist holds the frontend's build output, copied from web/dist by `npm run // sync` in web/. Only dist/.gitkeep is committed (Go can't embed a missing // directory), so a binary built without syncing first has no frontend. // //go:embed all:dist var dist embed.FS // Embedded returns the frontend's build output embedded in the binary, or // nil if none was synced before it was built (there is no index.html). func Embedded() fs.FS { files, err := fs.Sub(dist, "dist") if err != nil || CheckFS(files) != nil { return nil } return files }