fix(web): committed dist/.gitkeep keeps go:embed satisfiable pre-build
This commit is contained in:
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
Keeps //go:embed all:dist satisfiable before first npm run build.
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Placeholder so //go:embed all:dist stays satisfiable before the first
|
|
||||||
`npm run build` materializes web/dist (gitignored). Never served.
|
|
||||||
+3
-9
@@ -7,19 +7,13 @@ import (
|
|||||||
|
|
||||||
// DistFS holds the production SPA build (npm run build + precompress).
|
// DistFS holds the production SPA build (npm run build + precompress).
|
||||||
// Build scripts must materialize web/dist before `go build`; the directory is
|
// Build scripts must materialize web/dist before `go build`; the directory is
|
||||||
// gitignored. When dist is absent (fresh checkout / CI vet), the file-target
|
// gitignored except dist/.gitkeep, which keeps the pattern satisfiable on
|
||||||
// pattern below embeds nothing and LookupDist returns false so callers fall
|
// fresh checkouts. LookupDist returns false until a real build lands, so
|
||||||
// back to disk-only mode.
|
// callers fall back to disk-only mode.
|
||||||
//
|
//
|
||||||
//go:embed all:dist
|
//go:embed all:dist
|
||||||
var DistFS embed.FS
|
var DistFS embed.FS
|
||||||
|
|
||||||
// distPlaceholder keeps the embed pattern satisfiable on fresh checkouts
|
|
||||||
// where web/dist has never been built.
|
|
||||||
//
|
|
||||||
//go:embed dist_placeholder
|
|
||||||
var distPlaceholder []byte
|
|
||||||
|
|
||||||
// LookupDist returns the embedded dist subtree when the build populated it.
|
// LookupDist returns the embedded dist subtree when the build populated it.
|
||||||
func LookupDist() (fs.FS, bool) {
|
func LookupDist() (fs.FS, bool) {
|
||||||
sub, err := fs.Sub(DistFS, "dist")
|
sub, err := fs.Sub(DistFS, "dist")
|
||||||
|
|||||||
Reference in New Issue
Block a user