oliverfindl / vue-svg-inline-plugin

Vue plugin for inline replacement of SVG images with actual content of SVG files.
MIT License
33 stars 3 forks source link

Reduce bundle size #14

Closed markusand closed 2 years ago

markusand commented 2 years ago

I'm not an expert, I'm sorry if I'm wrong with my assumptions. Vue instance is injected in install method and Axios instance is passed in options object or taken from global scope. Would setting Vue and Axios as peerDependencies help reduce the size of the bundle?

oliverfindl commented 2 years ago

Hello,

well, I can set them as peerDependencies, but it won't solve your issue with bundle size, because this plugin is not using them at all.

https://github.com/oliverfindl/vue-svg-inline-plugin/blob/63566067340121503b46a6d66faac4be3742487a/package.json#L47-L51

Large bundle size is because of 2 things:

If you are using this plugin directly in browser (e.g.: via CDN), you can use modern version (-modern suffix in filename), which has no transpilation and no polyfills in place.

If you are using bundler, it's up to you to transpile it and include polyfills according your own needs.

If you have more questions, feel free to ask here.

Thanks.