svg-path-loader

0.0.4 • Public • Published

svg-path-loader

Codeship Status for svg-path-loader NPM version for 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',
}

Readme

Keywords

Package Sidebar

Install

npm i svg-path-loader

Weekly Downloads

648

Version

0.0.4

License

MIT

Last publish

Collaborators

  • christianv