MMF-FE / svgicon

SVG icon components and tool set
https://mmf-fe.github.io/svgicon
MIT License
922 stars 95 forks source link

Can vsvg be run during webpack build? #68

Closed rightaway closed 4 years ago

rightaway commented 6 years ago

Could the vsvg command that is run manually now be set up to automatically run on each build? Would this be a supported feature or something that could be added? That way I could drop any new svg files into my icons directory, and webpack would automatically take care of it and I could use the vue-svgicon tag in my vue components immediately.

rightaway commented 6 years ago

Especially useful for development mode using webpack-dev-server, the workflow isn't ideal right now as I'd like these icon files to be handled the same as all other development assets and JS files during production, rather than them needing to exist somewhere on the filesystem versus everything else not needing that.

Allenice commented 6 years ago

You can use programing api: https://github.com/MMF-FE/vue-svgicon#use-programming-api

rightaway commented 6 years ago

Would you consider adding a webpack loader at some point for this?

rightaway commented 6 years ago

If it's added then this package wouldn't need to handle svgo, because if it's part of a standard webpack build then we could just use the svgo-loader with the loader for vue-svgicon to take care of that.

Allenice commented 5 years ago

The next major version is add this feature, please try it and feedback. https://github.com/MMF-FE/vue-svgicon/tree/dev

rightaway commented 4 years ago

Any documentation for how to use the new feature? Didn't see anything in the readme.

Allenice commented 4 years ago

Any documentation for how to use the new feature? Didn't see anything in the readme.

https://github.com/MMF-FE/vue-svgicon/tree/dev