Documentation
¶
Index ¶
- func AssetHandler() http.Handler
- func ComponentImportPath(entryPath string, componentPath string) (string, error)
- func EmbeddedAssetHandler(assetsFS embed.FS) http.Handler
- func EntryNameForPath(componentPath string) string
- func GetAssets(man *Manifest, entryName string) (scriptSrc, cssHref string, chunks []string, isStatic bool, ssrPath string)
- func GetContentType(path string) string
- func HasSSREntries(man *Manifest) bool
- func PublicFileExistsInEmbed(assetsFS embed.FS, path string) bool
- func PublicFileExistsInFS(path string) bool
- func PublicHandler(assetsFS embed.FS, next http.Handler, isDev bool) http.Handler
- type Manifest
- type ManifestEntry
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssetHandler ¶
func ComponentImportPath ¶
func EntryNameForPath ¶
func GetContentType ¶
func HasSSREntries ¶
HasSSREntries returns true if the manifest contains any SSR pages. It checks both the Mode field (primary) and falls back to the SSR field for legacy manifests.
func PublicFileExistsInFS ¶
Types ¶
type Manifest ¶
type Manifest struct {
Entries map[string]ManifestEntry `json:"entries"`
Chunks map[string]string `json:"chunks,omitempty"`
}
func LoadManifest ¶
func LoadManifestFromEmbed ¶
func ParseManifest ¶
type ManifestEntry ¶
type ManifestEntry struct {
Script string `json:"script"`
CSS string `json:"css,omitempty"`
Chunks []string `json:"chunks,omitempty"`
Static bool `json:"static,omitempty"`
SSR string `json:"ssr,omitempty"`
Mode string `json:"mode,omitempty"`
HTML string `json:"html,omitempty"`
StaticRoutes map[string]string `json:"staticRoutes,omitempty"` // route -> html file path (for dynamic static pages)
}
Click to show internal directories.
Click to hide internal directories.