Closed KubaJastrz closed 4 years ago
Hey @KubaJastrz :wave:, Thank you for opening an issue. We'll get back to you as soon as we can. Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers. If you use SVGR at work, you can also ask your company to sponsor us :heart:.
@KubaJastrz you closed this as completed but was it? Or did you just decide to handle it manually?
@reintroducing I don't use any of the tools I mentioned anymore. Feel free to open a new issue.
@KubaJastrz are you using something else for this purpose now or just generally no need to do this anymore hence you don’t use it?
🚀 Feature Proposal
I want to have
--watch
flag insvgr
command. It would listen to file system changes for specified files/directories, similarly to postcss-cli, and process svg files to React components.Motivation
I am using snowpack with React. Snowpack doesn't have any built-in solutions for svgs, but is easily extensible with cli scripts. It has a capability to run commands in development, however, it doesn't provide any events on file system changes, so I can't use
svgr
command alone to rebuild files automatically.I am able to accomplish this with chokidar-cli, however, I really feel like this functionality could be a part of svgr package.
Example
input/tree.svg
,input/house.svg
,input/sun.svg
svgr --watch -d output input
input
get compiled initiallyinput/tree.svg
output/Tree.js
gets automatically rebuilt, but only this onePitch
This can be helpful for my use case. If you feel like my example is not enough, or this functionality belongs in snowpack itself, feel free to close it. I can help with the implementation and testing if needed.