Skip to content

perf: loads fonts from local #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -7,8 +7,6 @@
<meta name="viewport" content="width=device-width">
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="https://fonts.googleapis.com/css?family=Barlow:400,600" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Anonymous+Pro" rel="stylesheet">
<link rel="stylesheet" href="./stylesheets/styles.css">
</head>

@@ -18,4 +16,4 @@
<script type="text/javascript" src="js/utils.js" charset="utf-8"></script>
</body>

</html>
</html>
51 changes: 51 additions & 0 deletions app/stylesheets/_fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* Barlow 400, 600 */
/* latin-ext */
@font-face {
font-family: 'Barlow';
font-style: normal;
font-weight: 400;
src: local('Barlow Regular'), local('Barlow-Regular'), url(fonts/7cHpv4kjgoGqM7E_Ass5ynghnQci.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Barlow';
font-style: normal;
font-weight: 400;
src: local('Barlow Regular'), local('Barlow-Regular'), url(fonts/7cHpv4kjgoGqM7E_DMs5ynghnQ.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Anonymous Pro */
/* cyrillic */
@font-face {
font-family: 'Anonymous Pro';
font-style: normal;
font-weight: 400;
src: local('Anonymous Pro Regular'), local('AnonymousPro-Regular'), url(fonts/rP2Bp2a15UIB7Un-bOeISG3pHl829QP-4KuL2Q.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek */
@font-face {
font-family: 'Anonymous Pro';
font-style: normal;
font-weight: 400;
src: local('Anonymous Pro Regular'), local('AnonymousPro-Regular'), url(fonts/rP2Bp2a15UIB7Un-bOeISG3pHlg29QP-4KuL2Q.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* latin-ext */
@font-face {
font-family: 'Anonymous Pro';
font-style: normal;
font-weight: 400;
src: local('Anonymous Pro Regular'), local('AnonymousPro-Regular'), url(fonts/rP2Bp2a15UIB7Un-bOeISG3pHlU29QP-4KuL2Q.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Anonymous Pro';
font-style: normal;
font-weight: 400;
src: local('Anonymous Pro Regular'), local('AnonymousPro-Regular'), url(fonts/rP2Bp2a15UIB7Un-bOeISG3pHls29QP-4Ks.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 7 additions & 6 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ module.exports = {
rules: [
{
test: /\.tsx?$/,
use: [{loader: "ts-loader", options: {transpileOnly: true}}],
use: [{ loader: "ts-loader", options: { transpileOnly: true } }],
exclude: /node_modules/
},
{
@@ -48,11 +48,12 @@ module.exports = {
plugins: [
new CleanWebpackPlugin(pathsToClean),
new CopyWebpackPlugin([
{from: "manifest.json"},
{from: "index.html"},
{from: "./lib/*"},
{from: "stylesheets/*"},
{from: "images/*"}
{ from: "manifest.json" },
{ from: "index.html" },
{ from: "./lib/*" },
{ from: "stylesheets/*" },
{ from: "stylesheets/fonts/*" },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitmbee is this being redundant after defining { from: "stylesheets/*" } ?

{ from: "images/*" }
]),
new TsCheckerWebpackPlugin({
tsconfig: path.resolve("tsconfig.json"),
13 changes: 7 additions & 6 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ module.exports = {
rules: [
{
test: /\.tsx?$/,
use: [{loader: "ts-loader", options: {transpileOnly: true}}],
use: [{ loader: "ts-loader", options: { transpileOnly: true } }],
exclude: /node_modules/
},
{
@@ -45,11 +45,12 @@ module.exports = {
plugins: [
new CleanWebpackPlugin(pathsToClean),
new CopyWebpackPlugin([
{from: "manifest.json"},
{from: "index.html"},
{from: "./lib/*"},
{from: "stylesheets/*"},
{from: "images/*"}
{ from: "manifest.json" },
{ from: "index.html" },
{ from: "./lib/*" },
{ from: "stylesheets/*" },
{ from: "stylesheets/fonts/*" },
{ from: "images/*" }
])
]
};