Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to avoid drawer and minimap getting in the bundle? #492

Open
leejuyuu opened this issue Nov 27, 2023 · 0 comments
Open

Comments

@leejuyuu
Copy link

Hello, thanks for making this excellent library!

I have a question about reducing the bundle size. When I create a minimum graph without using minimap and drawers explicitly, these components are still included in the bundle and they take at least 80 KB. Is there any way to avoid them being included in the final bundle when not needed in the app?

A minimum working example:

  1. create-vite-app to create a svelte project (without sveltekit).
  2. Install svelvet (I am on 9.0.0).
  3. Replace the App.svelte with the following code (modified from the docs).
  4. Run vite-bundle-visualizer to see the final bundle.
// App.svelte
<script>
  import { Node, Svelvet } from 'svelvet';
</script>

<Svelvet id="my-canvas" width="{500}" height="{500}">
  <Node />
  <Node id="alpha" bgColor="red" label="Default Node" />
</Svelvet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant