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.

A way to reduce the bundle size

See original GitHub issue

I noticed that the my bundle size was too big and now I know that is vue-apexcharts is 455kb.

There is some way to reduce that?

Imgur

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
ollercommented, May 3, 2019

The bundle is very heavy at the moment, and would be a real blocker to a lot of people using this in production, which is a shame.

I’d agree with @unsalted, the ideal scenario is to allow the user’s to import the features they want, as opposed to making some best guessed groups lite, basic, etc.

Proper modularisation and exports as mentioned previously, i.e. albeit I’m in a vue scenario.

import { RadialBar } from 'vue-apexcharts'

Then you’re deferring the tree-shaking to the user’s webpack/rollup, they’d compile and tree-shake lib, not reference the precompiled /dist dir.

Would be a start, even if you did end up with a large common file with all the zoom/pan/export logic.

lodash and d3 are both good examples of how a lib has been properly modularised.

5reactions
ollercommented, May 7, 2019

On the other hand, allowing the user to import specific modules look good in theory, but will require a major rewrite in all parts. It might also be a pain for users who likes plug-n-play.

I’d take a look at d3, which has achieved exactly this, it still has a cdn hosted plug-n-play, all the while complete split up into microlibraries, so from a dev side, if I need scales, I can import d3-scale.

I appreciate this is a large refactor, but with apexcharts topping out at almost 500kb, that’s a real blocker to adoption, which seems a real shame considering all the great work going into this excellent lib.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Possible ways to reduce your webpack bundle size - Medium
Here are some cool ways you can reduce your webpack bundle size: ... Scope hoisting uses a smarter way to add the modules...
Read more >
How to Slim Down Your Bundle Size
Consider rewriting libraries that are large in size where you might not need all of its functionalities. · Check to see if you...
Read more >
Minimizing Webpack bundle size - Anvil
Learn how to minimize your Webpack bundle size by following these best practices, ensuring an optimal user experience.
Read more >
Reducing JavaScript Bundle Size. Part One
Code splitting is the ability to take a collection of modules, tied together in some pattern, and remove them from the main JavaScript...
Read more >
Small Bundles, Fast Pages: What To Do With Too Much ...
How does bundle size affect performance? · During page load: big bundles take longer to download. · During parse and compile: big bundles...
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