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

为何在项目中使用iconfont加载字体文件会报错 #96

Closed
GlacierXX opened this issue Sep 19, 2016 · 7 comments
Closed

为何在项目中使用iconfont加载字体文件会报错 #96

GlacierXX opened this issue Sep 19, 2016 · 7 comments

Comments

@GlacierXX
Copy link

image
image
image
atool-build有配置字体文件的loader,但是好像不起作用,在webpack.config.js中webpackConfig.module.loaders.push 也还是不起作用,是哪里出了问题呢?

@sorrycc
Copy link
Member

sorrycc commented Sep 19, 2016

路径不对? 用 ./iconfont.eot (加 ./ 前缀) 试试?

@GlacierXX
Copy link
Author

@sorrycc
image 直接import一个字体文件就可以,但是import less文件就报错,换了路径还是不行

@sorrycc
Copy link
Member

sorrycc commented Sep 19, 2016

@pigcan 有空看下。

@soda-x
Copy link

soda-x commented Sep 19, 2016

应该是 less-loader 的一个问题 webpack-contrib/less-loader#76

可以在引用字体文件的路径上加上

+ src: ~"url('./fonts/iconfont.eot')"

看看,不对的话自己再调整下 o.o

@GlacierXX
Copy link
Author

@sorrycc @pigcan 问题已经解决 多谢 !

@liupeng110112
Copy link

@GlacierXX 你那边是怎么解决的

@GlacierXX
Copy link
Author

@liupeng110112 就是按作者的解决办法
image

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

4 participants