1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-09 02:01:31 +08:00
Files
paper-manager/frontend/vben/main.go
源文雨 ae10a35264 fix zip
2023-05-01 00:35:58 +08:00

30 lines
547 B
Go

package vben
import (
"archive/zip"
"bytes"
_ "embed" // embed dist.zip
"io/fs"
"net/http"
)
//go:generate npm run build
//go:generate zip -9 -r dist.zip -x "dist/.DS_Store" "dist/*/.DS_Store" dist/*
//go:embed dist.zip
var distzipbytes []byte
// Distribution ...
var Distribution = func() http.FileSystem {
distzip, err := zip.NewReader(bytes.NewReader(distzipbytes), int64(len(distzipbytes)))
if err != nil {
panic(err)
}
distfs, err := fs.Sub(fs.FS(distzip), "dist")
if err != nil {
panic(err)
}
return http.FS(distfs)
}()