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