1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 22:39:18 +01:00

chore: updates to vite v5 (#2505)

This commit is contained in:
Amir Raminfar
2023-11-16 19:24:05 -08:00
committed by GitHub
parent f08518d442
commit 660b4c6f51
8 changed files with 404 additions and 36 deletions

View File

@@ -125,19 +125,19 @@ func (h *handler) readManifest() map[string]interface{} {
if h.config.Dev {
return map[string]interface{}{}
} else {
file, err := h.content.Open("manifest.json")
file, err := h.content.Open(".vite/manifest.json")
if err != nil {
// this should only happen during test. In production, the file is embedded in the binary and checked in main.go
return map[string]interface{}{}
}
bytes, err := io.ReadAll(file)
if err != nil {
log.Fatalf("Could not read manifest.json: %v", err)
log.Fatalf("Could not read .vite/manifest.json: %v", err)
}
var manifest map[string]interface{}
err = json.Unmarshal(bytes, &manifest)
if err != nil {
log.Fatalf("Could not parse manifest.json: %v", err)
log.Fatalf("Could not parse .vite/manifest.json: %v", err)
}
return manifest
}