maximalism2 / msvgc

Make React components from your plain SVG files
67 stars 14 forks source link

Cleanup name of generated javascript file and function #2

Closed mephinet closed 7 years ago

mephinet commented 7 years ago

Minor issue: if the filename of the input SVG is not a valid javascript name (e.g. because it contains dashes), the generated js is invalid:

const abc-def-ghi = props => (
...
)
thurt commented 7 years ago

i encountered this issue as well.

file naming with dashes is pretty common with graphic assets.

seems like it would make sense to convert this to camelCase.

TheTekton commented 7 years ago

This fork has commits in the development branch that adds support for --camelCase. It also has support for subdirectories in the svg directory, and a component index.js is written to the component output root.

Not sure if it's PR-worthy, but can start one for review, if @necinc asks.

maximalism2 commented 7 years ago

@TheTekton that's great idea! Could you please create the PR, and we will continue the conversation there?

maximalism2 commented 7 years ago

Resolved in #4