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

loading fonts via url() only works in production mode #41

Closed
Turbo87 opened this issue Feb 15, 2015 · 7 comments
Closed

loading fonts via url() only works in production mode #41

Turbo87 opened this issue Feb 15, 2015 · 7 comments

Comments

@Turbo87
Copy link

Turbo87 commented Feb 15, 2015

I observed some weird behavior when I was trying to use font-awesome in a webpack powered project.

I trimmed the code down as much as possible and put it into a gist: https://gist.github.com/Turbo87/e8e941e68308d3b40ef6

I installed font-awesome via npm and use require to import its CSS file through the style and css loaders. The CSS file has a @font-face which uses url() with a relative path to point to the font file(s). When I compile this with webpack in production mode everything works just as expected, but once I drop the -p parameter the code suddenly tries to load the font file from / for whatever reason and fails.

I observed that behavior with Google Chrome and Firefox, so it is probably not a browser issue.

@jhnns
Copy link
Member

jhnns commented Feb 17, 2015

Seems to be caused by the sourceMap option somehow

@Turbo87
Copy link
Author

Turbo87 commented Feb 23, 2015

@sokra @jhnns any ideas how to resolve this?

@sokra
Copy link
Member

sokra commented Feb 23, 2015

Switch off sourceMaps for CSS...

@sokra
Copy link
Member

sokra commented Feb 23, 2015

see #29

@Turbo87
Copy link
Author

Turbo87 commented Feb 23, 2015

well I consider switching sourceMaps off a workaround, but since this is a duplicate of #29 I'll close this issue. feel free to use the gist linked above as a way to reproduce the problem.

@Turbo87 Turbo87 closed this as completed Feb 23, 2015
@sokra
Copy link
Member

sokra commented Feb 23, 2015

yes, thanks. I would like to fix it, but the problem is that I have no idea how to do that. SourceMaps doesn't seem to work in <style> tags and a current approach give permission errors on external resources.

@Semigradsky
Copy link

The same issue. I hope a solution will be found.

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