Reduce bundle size?
Hey,
Is it possible to reduce the bundle size for the Vue 3 ApexCharts wrapper?
I have been having similar issue and I still can't figure a way to do this. The bundle size is too large, there should be a way we can load the chart modules separately like the way we do in lodash as an example. The bundle size is really affecting performance in production
would be great if we could only import what we need.
There won't be a way to achieve this without some significant refactoring of the underlying apexcharts package. Unlike other chart libraries, this one uses OOP with an entry/main class that then dynamically calls the chart based on a type passed at runtime.
This means that treeshaking can't work because there's no way for the bundler to know what type of chart might be called.
They'd need to do away with that entry class and refactor it completely into ES6 modules which then call further ES6 modules that are depended on, then your bundle could be like "Oh, they used import { BarChart } from "apexcharts";, therefore I only need the modules imported by BarChart".
In short, it's a hell of a lot of work.