Open shayan-binary-2 opened 4 years ago
I also met,As shown
linearGradient
、mask
@shayan-binary-2 actually svg-sprite-loader doesn't remove <linearGradient />
or other tags, if you open http://localhost:8080/sprite-c642ba.mylib.svg#normal-usage in your demo, you can see that gradient is on place:
The problem is in browsers: unfortunately they have weird support of referencing external SVGs via <use xlink:href>
. I suggest you to use extract-svg-sprite-webpack-plugin and refer to SVG from CSS. It the most bulletproof solution :)
I am using and
svg-sprite-loader
on react app which use webpack. the problem is that it removes the<linearGradient>
tags,package.json
webpack.config.js
and here how I use the Icon
import MySvg from './path-to/my-icon.svg';
everything goes well and it works, but as it remove those tags, the svg file not properly loaded. Also should notice I have check other issues, but none of them fix my problem. I made a sample repo here https://github.com/shayan-binary-2/svg-sprite-loader-sample