Skip to content
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

react项目中引入fontmin 编译报错 #119

Open
coderi521 opened this issue Aug 14, 2024 · 5 comments
Open

react项目中引入fontmin 编译报错 #119

coderi521 opened this issue Aug 14, 2024 · 5 comments

Comments

@coderi521
Copy link

D-Chat_20240814201604

@coderi521
Copy link
Author

Uploading img.png…

@kekee000
Copy link
Contributor

kekee000 commented Sep 19, 2024

看着像 Node 版本不兼容, 请提供 Node 版本和系统环境,以及报错详情和复现方法,多谢。

@yangyu521
Copy link

node版本 14.19.3
可以随便使用vue或者react创建一个demo,引入fontmin就会报错,猜测原因是fontmin中还有一些依赖中用到了fs(node下的api),所以想确定下fontmin是不支持浏览器环境下裁剪嘛,我现在是想在浏览器环境下,生成ttf、woff、woff2的裁剪文件,目前卡在依赖报错上了。
示例:
const Fontmin = require("fontmin");
export function minifyFont() {
return new Fontmin()
} // 报错

@kekee000
Copy link
Contributor

fontmin 不支持 浏览器环境,可以使用 fonteditor-core 模块,支持 ttf 裁剪,具体示例参考 test case。

@yangyu521
Copy link

yangyu521 commented Oct 30, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants