Frontend: Extract CSS imports into files (#94655)
* build(webpack): extract css imports into files including node_modules * feat(webassets): add cssfiles to entrypoint assets for extracted css files * feat(views): add entrypoint css link tags to html templates * feat(webassets): set CDN prefix for CSS files * test(webassets): trim down sample-assets-manifest, fix failing snapshot tests * Update pkg/api/webassets/webassets_test.go Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> * build(webpack): remove css module loader --------- Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
co-authored by
Marcus Efraimsson
parent
65fc7cf004
commit
cfb46c8003
@@ -39,9 +39,11 @@ type IndexViewData struct {
|
||||
type EntryPointAssets struct {
|
||||
ContentDeliveryURL string `json:"cdn,omitempty"`
|
||||
JSFiles []EntryPointAsset `json:"jsFiles"`
|
||||
CSSFiles []EntryPointAsset `json:"cssFiles"`
|
||||
Dark string `json:"dark"`
|
||||
Light string `json:"light"`
|
||||
Swagger []EntryPointAsset `json:"swagger"`
|
||||
SwaggerCSSFiles []EntryPointAsset `json:"swaggerCssFiles"`
|
||||
}
|
||||
|
||||
type EntryPointAsset struct {
|
||||
@@ -59,7 +61,13 @@ func (a *EntryPointAssets) SetContentDeliveryURL(prefix string) {
|
||||
for i, p := range a.JSFiles {
|
||||
a.JSFiles[i].FilePath = prefix + p.FilePath
|
||||
}
|
||||
for i, p := range a.CSSFiles {
|
||||
a.CSSFiles[i].FilePath = prefix + p.FilePath
|
||||
}
|
||||
for i, p := range a.Swagger {
|
||||
a.Swagger[i].FilePath = prefix + p.FilePath
|
||||
}
|
||||
for i, p := range a.SwaggerCSSFiles {
|
||||
a.SwaggerCSSFiles[i].FilePath = prefix + p.FilePath
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user