mirror of
https://github.com/wweir/sower.git
synced 2026-10-19 16:14:33 +00:00
Add /web/dist to .gitignore, untrack the committed vite build output, and update the embed.go comment to reflect that dist is generated by the Makefile web target instead of being committed.
23 lines
531 B
Go
23 lines
531 B
Go
// Package web embeds the built admin console frontend into the binary.
|
|
// The dist directory is generated by `bun run build` in this directory
|
|
// (see the Makefile `web` target, a prerequisite of the sower build).
|
|
package web
|
|
|
|
import (
|
|
"embed"
|
|
"fmt"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed all:dist
|
|
var dist embed.FS
|
|
|
|
// Dist returns the embedded frontend filesystem rooted at the dist directory.
|
|
func Dist() (fs.FS, error) {
|
|
sub, err := fs.Sub(dist, "dist")
|
|
if err != nil {
|
|
return nil, fmt.Errorf("web dist: %w", err)
|
|
}
|
|
return sub, nil
|
|
}
|