From fc7542e01f1d6f9e1c11bacf0060c0165ba54986 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 31 May 2024 03:10:46 +0200 Subject: build: re-enable asset reloading in dev --- frontend/assets.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'frontend') diff --git a/frontend/assets.go b/frontend/assets.go index a6a5e79..286d505 100644 --- a/frontend/assets.go +++ b/frontend/assets.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" ) -var Assets = AssetCollection{ +var Assets = &AssetCollection{ Scripts: make(map[string]Asset), Stylesheets: make(map[string]Asset), } @@ -83,12 +83,21 @@ func hashStyles() error { return nil } -func init() { - err := hashScripts() +func Rehash() (err error) { + err = hashScripts() if err != nil { - panic(err) + return err } err = hashStyles() + if err != nil { + return err + } + + return nil +} + +func init() { + err := Rehash() if err != nil { panic(err) } -- cgit 1.4.1