Dev mode does not need make assets any more

- Only when using the buildflag `-tags dev` local file
- files are loaded directly from the file system instead of the compiled binary
- had to move `//go:generate esc …` from `server/http.go`to `main.go` as otherwise the stored local paths of the files wouldn’t be correct
- Moved the `liveAssets` constants definition into two separate files, where one is included when building for dev, and one when it isn’t
- move the tempate parsing into the handler in `http.go` as otherwise template changes would not be considered
This commit is contained in:
Andreas Linde 2020-07-28 15:43:34 +02:00
parent caffcfda59
commit edd833db82
No known key found for this signature in database
GPG key ID: 96178502495847D9
5 changed files with 78 additions and 68 deletions

View file

@ -1,5 +1,7 @@
package main
//go:generate esc -o server/assets.go -pkg server -modtime 1566640112 -ignore .DS_Store -prefix assets assets
import (
"github.com/andig/evcc/cmd"
)