-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Include only necessary fonts for target environment specified by Browserslist #1674
Conversation
…serslist Allow WOFF and WOFF2 to be controlled using environment variables
Codecov Report
@@ Coverage Diff @@
## master #1674 +/- ##
=======================================
Coverage 93.67% 93.67%
=======================================
Files 80 80
Lines 4666 4666
Branches 813 813
=======================================
Hits 4371 4371
Misses 261 261
Partials 34 34
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried BROWSERSLIST="Chrome 68" USE_WOFF2=true yarn build
and the fonts worked. The dist/fonts
only contained .woff2
files. I checked dist/katex.js
and the code had been compiled down to ES5. I tried BROWSERSLIST="Chrome 68" yarn build
with the same results.
@kevinbarabash There was a bug in #1595, where Browserslist config is not read even if |
Codecov Report
@@ Coverage Diff @@
## master #1674 +/- ##
=======================================
Coverage 93.66% 93.66%
=======================================
Files 80 80
Lines 4653 4653
Branches 807 807
=======================================
Hits 4358 4358
Misses 261 261
Partials 34 34
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I finally got around to testing this again. The browserslist setting is working correctly. Thanks for adding this feature. I'm personally looking forward to using this at Khan Academy once we finish our migration to webpack.
Fixes #1667.
Closes #1495.
+ Allow WOFF and WOFF2 to be controlled using environment variables like TTF. (
USE_TTF
) These environment variables will override target environment.Uses caniuse data to detect support. No additional dependencies are required, as they are already included in other dependencies.