Skip to content

0.8.0 breaks svg sprite #1153

Closed
Closed
@bogdansoare

Description

@bogdansoare

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions