mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Enable environment variable USE_TTF to disable bundling TTF fonts (#1600)
* Use environment variable USE_TTF to disable bundling TTF fonts * Do not bundle TTF fonts on CircleCI build
This commit is contained in:
@@ -80,7 +80,7 @@ jobs:
|
||||
|
||||
- run:
|
||||
name: Build KaTeX
|
||||
command: yarn build
|
||||
command: USE_TTF=false yarn build
|
||||
|
||||
- store_artifacts:
|
||||
path: dist/katex.min.js
|
||||
|
@@ -49,6 +49,13 @@ function createConfig(target /*: Target */, dev /*: boolean */,
|
||||
});
|
||||
}
|
||||
|
||||
const lessOptions = {};
|
||||
if (process.env.USE_TTF === "false") {
|
||||
lessOptions.modifyVars = {
|
||||
'use-ttf': false,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
mode: dev ? 'development' : 'production',
|
||||
context: __dirname,
|
||||
@@ -85,7 +92,10 @@ function createConfig(target /*: Target */, dev /*: boolean */,
|
||||
use: [
|
||||
dev ? 'style-loader' : MiniCssExtractPlugin.loader,
|
||||
...cssLoaders,
|
||||
'less-loader',
|
||||
{
|
||||
loader: 'less-loader',
|
||||
options: lessOptions,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user