@@ -0,0 +1,19 @@
|
||||
// Package webui 承载前端构建产物的 go:embed 嵌入。
|
||||
// dist 由构建脚本从 oci-portal-dash/dist 拷入覆盖;
|
||||
// 仓库只提交占位 index.html,保证裸 clone 后 go build 可过。
|
||||
package webui
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
// all: 前缀连同 _ / . 开头文件一并嵌入(vite 产物含下划线开头的 chunk)。
|
||||
//
|
||||
//go:embed all:dist
|
||||
var distFS embed.FS
|
||||
|
||||
// Dist 返回以 dist 为根的只读文件系统,供 HTTP 层直接伺服。
|
||||
func Dist() (fs.FS, error) {
|
||||
return fs.Sub(distFS, "dist")
|
||||
}
|
||||
Reference in New Issue
Block a user