// Package webdist embeds the production web build so pansy ships as one static // binary. The Makefile syncs web/dist into this package's dist/ directory before // `go build`; a minimal placeholder dist/index.html is committed so the module // builds without a web build present (the Makefile overwrites it). package webdist import ( "embed" "io/fs" ) //go:embed all:dist var embedded embed.FS // Dist returns the embedded web build rooted at its top level (index.html, // assets/…), ready to hand to api.RegisterSPA. func Dist() fs.FS { sub, err := fs.Sub(embedded, "dist") if err != nil { // Only possible if the embed directive and this path disagree — a build-time bug. panic("webdist: dist subtree missing: " + err.Error()) } return sub }