mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-27 14:09:19 +00:00
Fix fonts precaching (#3338)
* Fix font urls * Don't zopfli nonexisting fonts
This commit is contained in:
@@ -69,10 +69,6 @@ function copyMapPanel(staticDir) {
|
||||
|
||||
function compressStatic(staticDir) {
|
||||
const staticPath = genStaticPath(staticDir);
|
||||
const fonts = gulp
|
||||
.src(staticPath("fonts/**/*.ttf"))
|
||||
.pipe(zopfli())
|
||||
.pipe(gulp.dest(staticPath("fonts")));
|
||||
const polyfills = gulp
|
||||
.src(staticPath("polyfills/*.js"))
|
||||
.pipe(zopfli())
|
||||
@@ -82,7 +78,7 @@ function compressStatic(staticDir) {
|
||||
.pipe(zopfli())
|
||||
.pipe(gulp.dest(staticPath("translations")));
|
||||
|
||||
return merge(fonts, polyfills, translations);
|
||||
return merge(polyfills, translations);
|
||||
}
|
||||
|
||||
gulp.task("copy-static", (done) => {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<link rel="preload" href="<%= latestPageJS %>" as="script" crossorigin="use-credentials" />
|
||||
<link
|
||||
rel="preload"
|
||||
href="/static/fonts/roboto/Roboto-Light.ttf"
|
||||
href="/static/fonts/roboto/Roboto-Light.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
href="/static/fonts/roboto/Roboto-Regular.ttf"
|
||||
href="/static/fonts/roboto/Roboto-Regular.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<link rel="preload" href="<%= latestPageJS %>" as="script" crossorigin="use-credentials" />
|
||||
<link
|
||||
rel="preload"
|
||||
href="/static/fonts/roboto/Roboto-Light.ttf"
|
||||
href="/static/fonts/roboto/Roboto-Light.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
href="/static/fonts/roboto/Roboto-Regular.ttf"
|
||||
href="/static/fonts/roboto/Roboto-Regular.woff2"
|
||||
as="font"
|
||||
crossorigin
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user