large dependancy snapsvg
See original GitHub issueCurrently webpack-analyzer throws up snapsvg-cjs
as being a very large dependancy
245 KiB
Are there any alternatives to this? as this seems excessive.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Snap.svg | James Scheller
A big part of the trouble with this approach is that it intrinsically couples a large number of external dependencies together. My Vue.js...
Read more >Snap.svg API Reference
Creates a drawing surface or wraps existing SVG element. Parameters. width number string ...
Read more >Snap.svg with Vue.js - Stack Overflow
js file ! When I try to import the dependency into my main.js file or into any component I've got no error but...
Read more >snap.svg.zpd - npm
A zoom/pan/drag plugin for Snap.svg. This is an adaptation of Andrea Leofreddi's SVGPan library, version 1.2.2, for use as a Snap.svg plugin ...
Read more >14 best alternatives to Snap.svg as of 2022 - Slant.Co
Snap.svg JavaScript library makes working with your SVG assets as easy as jQuery makes working with the ... Easiest to learn to obtain...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@negomi
Actually I just did a brief investigation into the codebase and I realised that only a few menus actually use snap-svg.
You also correctly export the full path structure of the library.
There for those rollup/webpack users can cherry pick the menu they need without importing those they dont.
e.g.
For us this saved 80Kb even after GZip … thats impressive.
Perhaps this should be noted in the docs.
Hi @andrewmclagan, yep, I’m aware of this issue 😕
Aside from replacing the Snap.svg dependency with another library, I don’t currently know of a way to avoid this, and I’m afraid I don’t have much time to work on it at the moment.
I’d accept a PR if anyone else has any suggestions.