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 configimport path1 from 'svg-path-loader!./image1.svg'; // With a webpack loader configimport path2 from './image2.svg'; // Construct your SVG { return <svg = = ="0 0 16 16"> <path = /> </svg> ;}
Webpack loader config
test: /\.svg$/ loader: 'svg-path-loader'