svgpack-loader
v0.1.1
Published
Webpack SVG Loader folders,librarys and ... For Javascript Projects
Downloads
5
Readme
svg-json-parser
this App imports SVG Element in webpack boulne.js file.
npm install svgpack-loader;
var lib = require("svgpack!./svgmap.json");
class Icon extends React.Component {
render(){
var s = svglib[this.props.id];
if(s.node=="g"){return (<g >{sv.children.map((e,i)=><path d={e.d} fill={e.fill} key={i} ></path>)}</g>);}
else if(s.node=="path"){return (<path d={s.d} fill={s.fill} ></path>);}
}
}
<Icon id='work' />