-
Notifications
You must be signed in to change notification settings - Fork 811
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
installing awesome-font on with npm, wrong output url #1292
Comments
In your main @import "~font-awesome/scss/font-awesome.scss"; |
I followed your advice and it's the same thing |
You'll need to tweak the value for |
Add this snippet to
|
@artemsky I read the doc of font awesome, but the problem does not come from the installing way, it's happens also with importing of others library having resources in public path. I solved the problem by adding |
Maybe a bit neater solution that works for fas 5.1.:
sass/app.scss:
Note that variable import is above fas import, that is important. _sass/variables.scss webpack.mix.js
Here order is also important. And at last |
I've been struggling with this too and found my way around. See Font URLs are not respecting the public path when compiling Sass #474 |
@attilaantal saved me some time on this. Thanks! I improved your solution and added an env variable for easier config: .env: webpack.mix.js: Works like a charm! |
Description:
Hello,
trying to install the font-awesome with npm and when compiling
1. First
the fonts are copied by default to the folder
public/fonts/vendor/font-awesome
I do not want that, normally they should be copied directly to the folder
public/fonts
, according to the different tutorials I readfolder.
2. Second
when compiling with npm run dev command, the output url to my images in my app.css file cannot be resolved, a relative path are wrong.
i get this :
src: url("/fonts/vendor/font-awesome/fontawesome-webfont.eot?v=4.7.0");
instead of
src: url("../fonts/vendor/font-awesome/fontawesome-webfont.eot?v=4.7.0");
the ".." in prefix are missing, I have to add them manually after compilation, to have a nice display of my fonts
Steps To Reproduce:
installing awesome font with npm
npm install awesome-font --save-dev
importing fonts in my app.scss file
the variable $fa-font-path is setted in _variables.scss of my font-awessome
$fa-font-path: "~/fonts" !default;
compiling of my css file and JavaScript with the command
npm run dev
The text was updated successfully, but these errors were encountered: