Browse Source

[Beta] Serve fonts from same domain

main
Dan Abramov 3 years ago
parent
commit
663f975620
  1. 2
      beta/package.json
  2. 4
      beta/src/components/Seo.tsx
  3. 6
      beta/src/styles/index.css

2
beta/package.json

@ -6,7 +6,7 @@
"scripts": {
"analyze": "ANALYZE=true next build",
"dev": "next",
"build": "next build && node ./scripts/generateRSS.js && node ./scripts/generateRedirects.js",
"build": "next build && node ./scripts/generateRSS.js && node ./scripts/generateRedirects.js && node ./scripts/downloadFonts.js",
"lint": "next lint",
"lint:fix": "next lint --fix",
"format:source": "prettier --config .prettierrc --write \"{plugins,src}/**/*.{js,ts,jsx,tsx,css}\"",

4
beta/src/components/Seo.tsx

@ -91,14 +91,14 @@ export const Seo = withRouter(
/>
<link
rel="preload"
href="https://conf.reactjs.org/fonts/Optimistic_Display_W_Md.woff2"
href="https://beta.reactjs.org/fonts/Optimistic_Display_W_Md.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
<link
rel="preload"
href="https://conf.reactjs.org/fonts/Optimistic_Display_W_Bd.woff2"
href="https://beta.reactjs.org/fonts/Optimistic_Display_W_Bd.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"

6
beta/src/styles/index.css

@ -17,7 +17,7 @@
@font-face {
font-family: 'Optimistic Display';
src: url('https://conf.reactjs.org/fonts/Optimistic_Display_W_Lt.woff2')
src: url('https://beta.reactjs.org/fonts/Optimistic_Display_W_Lt.woff2')
format('woff2');
font-weight: 300;
font-style: normal;
@ -26,7 +26,7 @@
@font-face {
font-family: 'Optimistic Display';
src: url('https://conf.reactjs.org/fonts/Optimistic_Display_W_Md.woff2')
src: url('https://beta.reactjs.org/fonts/Optimistic_Display_W_Md.woff2')
format('woff2');
font-weight: 500;
font-style: normal;
@ -35,7 +35,7 @@
@font-face {
font-family: 'Optimistic Display';
src: url('https://conf.reactjs.org/fonts/Optimistic_Display_W_Bd.woff2')
src: url('https://beta.reactjs.org/fonts/Optimistic_Display_W_Bd.woff2')
format('woff2');
font-weight: 700;
font-style: normal;

Loading…
Cancel
Save