Ant Design使用离线Icon

项目antd版本号:"antd": "3.7.3",
antDesignPro版本:"name": "ant-design-pro", "version": "1.3.0",

解决办法
安装antd-iconfont

npm i antd-iconfont
npm run build

1.将node-modules里面的antd-iconfont放到static目录下,文件夹命名iconfont,如下图所示


image.png

2.在dist下css文件中搜索https://at.alicdn.com,替换成iconfont里面的相对路径,我这里有四处,.eot .woff等

url("./static/iconfont/iconfont.eot");
url("./static/iconfont/iconfont.woff") format("woff"),
url("./static/iconfont/iconfont.ttf") format("truetype"),
url("./static/iconfont/iconfont.svg")

就酱,缺点是每次build都要修改dist文件

目前更简便更合适的方法还没找到。。。

你可能感兴趣的:(Ant Design使用离线Icon)