question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

large dependancy snapsvg

See original GitHub issue

Currently 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
andrewmclagancommented, Apr 29, 2017

@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.

import BurgerMenu from 'react-burger-menu/lib/menus/push';

For us this saved 80Kb even after GZip … thats impressive.

Perhaps this should be noted in the docs.

1reaction
negomicommented, Apr 28, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found