dist.go 598 B

12345678910111213141516
  1. package sub
  2. import "embed"
  3. // distFS holds the Vite-built frontend filesystem, injected from main at
  4. // startup. The `web` package owns the //go:embed directive (because dist/
  5. // is at web/dist/), and hands the FS over via SetDistFS so the sub package
  6. // doesn't import web — that would create an import cycle once any
  7. // web/controller handler reuses sub's link-building service.
  8. var distFS embed.FS
  9. // SetDistFS installs the embedded frontend filesystem the sub server uses
  10. // for its info page assets. Must be called before NewServer().Start().
  11. func SetDistFS(fs embed.FS) {
  12. distFS = fs
  13. }