// Package webui embeds the compiled React bundle produced by `make build`. // // The `dist` directory is populated by the build pipeline (npm run build copies // frontend/dist into backend/webui/dist). A placeholder index.html is checked // in so the backend always compiles and runs, even in a fresh checkout where // the frontend has not been built yet. package webui import ( "embed" "io/fs" ) //go:embed all:dist var assets embed.FS // FS returns the root of the embedded bundle, or nil when the placeholder build // is still in place and no real frontend bundle has been compiled. func FS() fs.FS { sub, err := fs.Sub(assets, "dist") if err != nil { return nil } if _, err := fs.Stat(sub, "index.html"); err != nil { return nil } return sub } // Assets exposes the raw embedded filesystem, including the dist prefix. func Assets() fs.FS { return assets }