Fix fonts precaching (#3338)

* Fix font urls

* Don't zopfli nonexisting fonts
This commit is contained in:
Paulus Schoutsen 2019-07-10 08:18:04 -07:00 committed by GitHub
parent 628692b2e9
commit 2929db5ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -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) => {

View File

@ -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
/>

View File

@ -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
/>