mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
Include only necessary fonts for target environment specified by Browserslist (#1674)
* Include only necessary fonts for target environment specified by Browserslist Allow WOFF and WOFF2 to be controlled using environment variables * Fix links * Fix merge error * Update dependencies * Replace uglifyjs-webpack-plugin with terser-webpack-plugin * Do not set `targets` if !isESMBuild
This commit is contained in:
committed by
Kevin Barabash
parent
64745b5c8a
commit
ce3840d4ce
10
docs/node.md
10
docs/node.md
@@ -36,6 +36,16 @@ yarn
|
||||
yarn build
|
||||
```
|
||||
|
||||
It will automatically transpile code and include only necessary fonts for
|
||||
target environments specified by [Browserslist config](https://github.com/browserslist/browserslist#environment-variables).
|
||||
For example, if you are making a web app for a kiosk with Chrome 68, run
|
||||
`BROWSERSLIST="Chrome 68" yarn build` and it will produce build with no
|
||||
transpilation, as it fully supports ES6, and only include WOFF2 fonts.
|
||||
|
||||
You can override included fonts using environment variables. Set `USE_(FONT NAME)`
|
||||
environment variable to `"true"` or `"false"`, to force a font type to be included
|
||||
or excluded, respectively.`
|
||||
|
||||
If you'd like to use the built KaTeX in other projects, install the package by
|
||||
specifying the path:
|
||||
```bash
|
||||
|
Reference in New Issue
Block a user