question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why do SVG images compile into the fonts folder?

See original GitHub issue

I’m wondering why this behavior happens and how to override it?

Regular images (png, jpg) go into the correct images folder. but SVG’s all go to the fonts folder.

My css:

.foo{ background: url(../images/normal_icon.png) }
.bar{ background: url(../images/icon.svg) }

Converts to:

.foo { background: url(/image/normal_icon.png?id=a72845c0a452ccc7003a) }
.bar { background: url(/fonts/icon.svg?id=085742210e6d227f68b0) }`

My mix file is:

const { mix } = require('laravel-mix')

mix.setPublicPath('public')
   .js('app/Assets/js/app.js', 'js')
   .sass('app/Assets/css/test.scss', 'css')
   .copy('app/assets/images', 'public/images', false)
   .version()
   .version('public/images/**/*')
   .disableNotifications();

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
adriandmitrocacommented, Nov 14, 2017

FYI: SVG fonts are deprecated and useless anyway, really don’t see any point of having this - https://caniuse.com/#feat=svg-fonts

In fact, it would be nice to have SVGs moved into some other place than just images directory, like vectors, or something that can be configured by modifying the variable.

@JeffreyWay

5reactions
stephan-vcommented, Oct 29, 2017

@heihachi88

I had a simple fix for this but it go closed.

https://github.com/JeffreyWay/laravel-mix/pull/672

I simply can not see why this would not go through now, since there is an overwhelming response to drop SVG’s from being seen as fonts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do SVG images compile into the fonts folder? · Issue #1231
Regular images (png, jpg) go into the correct images folder. but SVG's all go to the fonts folder. My css: .foo{ background: url(....
Read more >
Using Custom Fonts With SVG in an Image Tag | CSS-Tricks
When we produce a PNG image, we use an <img> tag or a CSS background, and that's about it. It is dead simple...
Read more >
What Is an SVG Font? All About SVG Fonts
An SVG font is a new version of the OpenType format, with SVG standing for Scalable Vector Graphics. The SVG glyph format allows...
Read more >
Why is my SVG file not using my font file? - Stack Overflow
Make sure the desired font is installed locally (in you OS). Open your svg in an graphic editor like inkscape.
Read more >
Building an SVG Icon Font - CDNify
Grouping: Icon fonts are grouped into one file which means only one http request. Scaling: Vectors can be resized without losing image quality....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found