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.

0.8.0 breaks svg sprite

See original GitHub issue

The change in 0.8.0 to use url-loader with limit 10k as a default loader breaks my svg sprite system.

The svg sprite system works like this: I put all my svgs in one folder, run svg-sprite to generate svg sprite (which is below 10k), then I have a custom Icon component in which I import the svg sprite and load the apropriate icon using fragment identifiers

Icon Component:

import React, { PropTypes } from 'react'
import svgSprite from '../img/symbol/sprite.svg'

function Icon({ name }) {
  return (
    <svg>
      <use xlinkHref={`${svgSprite}#${name}`} />
    </svg>
  )
}

Any idea how to fix this besides just adding more svgs to the sprite until it is bigger than 10k?

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
mzedelercommented, Jun 13, 2018

What is required to make inlining of svg images below 10k work (again)?

0reactions
tilmancommented, Jul 10, 2018

Is there a Option to re-activate base64 import for SVGs? I’m using SVGs in my CSS and i don’t like the workflow of manually transforming it to base64 first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gulp-svg-sprite | Yarn - Package Manager
is a Gulp plugin wrapping around svg-sprite which takes a bunch of SVG files, optimizes them and bakes them into SVG sprites of...
Read more >
ng-svg-icon-sprite - npm
This npm module in Angular package format provides both a solution for generating SVG sprites and a component for including them.
Read more >
SVG sprites. Last updated: 3/6/19 | by Tony Montemorano
In this post we'll review some important considerations, and illustrate some ways to implement a scaleable SVG sprite design/development ...
Read more >
A Few Different Ways To Use SVG Sprites In Animation
Technique #1: Complex Responsive Animation With An SVG Sprite ... This article by Ilya Pukhalski breaks down Joe Harrison's responsive icons technique in...
Read more >
Unable to fix package vulnerability (svg-sprite-loader)
Running npm audit finds 4 vulnerabilities and suggests forcing a breaking change to svg-sprite-loader (reverting it from v6 back to v2??)
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