IconFont Componentized 是一系列工具,用于生成 IconFont 组件用于各种框架/环境中。
- 安装依赖
npm install @iconfont-componentized/cli -D
- 生成配置文件
iconfont-componentized.json
{
"$schema": "https://raw.githubusercontent.com/axetroy/iconfont-componentized/main/packages/share/src/config/schema.json",
"defaultSize": 32,
"classNamePrefix": "icon-font"
}
- 获取 IconFont 的地址
- 添加生成脚本到
package.json
"script": {
"iconfont": "iconfont-componentized --url https://at.alicdn.com/t/font_caopq7l9o8t1emi.js --config iconfont-componentized.json"
}
- 生成组件
npm run iconfont
git clone https://github.com/axetroy/iconfont-componentized
cd iconfont-componentized
pnpm install
pnpm test