Laravel 5.4 - Bootstrap glyphicons don't work after sass integration
See original GitHub issueUse Laravel 5.4 Fresh Installation. Did npm run dev
. Bootstrap, Jquery worked perfect, but Glyphicons weren’t displayed. Checking my public/css/app.css
I saw, that Glyphicons font-face path are not suitable.
src: url(/fonts/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1);
If I, manually use ../fonts
instead of /fonts
it will work. I tried to figure out and edit the default path in _variables.css
. I set:
$icon-font-path = "../fonts" - but npm gives error
By default it is: "~bootstrap-sass/assets/fonts/bootstrap/"
Copied fonts folder inside puclic/css
folder, didn’t work.
Added options to the webpack.mix.js
file:
options({processCssUrls: false})
and in _variables.css
again set:
$icon-font-path = "../fonts"
Run npm-run-dev
and it worked, glyphicons were displayed. But, I don’t want to set false for processCssUrls
. Because, in this case I will not able to minimize css files using command: npm run production
.
I updated laraval-mix version to 0.10.0
, wasn’t positive result.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (2 by maintainers)
Top GitHub Comments
You can solve this problmem with CDN of BOOTSTRAP
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">@jeanfredson CDN defeats the whole purpose of using Laravel-Mix.