awesome-webpack
awesome-webpack copied to clipboard
Add JetBrains/svg-sprite-loader
trafficstars
Hello. I was using this plugin for some time and it's seems to be useful and handy. I use it in that way:
import React from 'react';
const svgModules = require.context('Images/sprite', false, /\.svg$/);
svgModules.keys().forEach(svgModules);
const Icon = function ({ name, ...rest }) {
return (
<svg {...rest}>
<use xlinkHref={ `#${ name }` } />
</svg>
);
};