svg-path-loader
v0.0.4
Published
Webpack loader to get the first path in a SVG file
Downloads
2,069
Readme
svg-path-loader
Webpack loader to get the first path in an SVG file.
Install
npm i svg-path-loader
Usage
// Without a webpack loader config
import path1 from 'svg-path-loader!./image1.svg';
// With a webpack loader config
import path2 from './image2.svg';
// Construct your SVG
export default function Icon() {
return (
<svg height={16} width={16} viewBox="0 0 16 16">
<path d={path1} />
</svg>
);
}
Webpack loader config
{
test: /\.svg$/,
loader: 'svg-path-loader',
}