jhamlet / svg-react-loader

Webpack SVG to React Component Loader
MIT License
559 stars 82 forks source link

`util/title-case.js` doesn't handle file names with dots properly #49

Closed ofagbemi closed 7 years ago

ofagbemi commented 7 years ago

Importing an SVG with the filename hello.inline.svg causes the component to default to an invalid name — function Hello.inline ()

jhamlet commented 7 years ago

This is in version 0.4.0? Want to contribute?

jessy1092 commented 7 years ago

I use the 0.4.3 and it has the same issue.

ERROR in ./src/images/icon/minus.inline.svg
Module build failed: SyntaxError: F:/workspace/src/images/icon/minus.inline.svg: Unexpected token, expected ( (3:14)

  1 | var React = require('react');
  2 |
> 3 | function Minus.inline (props) {
    |               ^
  4 |     return React.createElement("svg",props,React.createElement("path",{"fill":"#67696B","fillRule":"evenodd","d":"M0 1.097C0 .491.5 0 1.092 0h13.64c.603 0 1.092.487 1.092 1.097 0 .606-.5 1.098-1.093 1.098H1.092A1.092 1.092 0 0 1 0 1.097z"}));
  5 | }
  6 |