Closed lsnow99 closed 2 years ago
Having trouble getting tree-shaking to work with Chart.js and vue-chart-3
In my main.js:
// Import depedencies for vue-chart-3 from chart.js import { Chart, BarElement, Tooltip, Legend, BarController, CategoryScale, LinearScale, PieController, ArcElement, } from "chart.js"; Chart.register( BarController, BarElement, Tooltip, Legend, CategoryScale, LinearScale, PieController, ArcElement );
I am getting this result when I analyze my vendor bundle:
In vue-chart-3/dist/components.js I see this (line 7 for me): const chart_js_1 = require("chart.js");
const chart_js_1 = require("chart.js");
So is it possible vue-chart-3 isn't using tree shaking?
vue-chart-3
v3.0.9
3.2.29
Looking into it more, it may be that my visualizer tool does not have great support for treeshaking: https://github.com/btd/rollup-plugin-visualizer/issues/96
Describe the bug
Having trouble getting tree-shaking to work with Chart.js and vue-chart-3
To Reproduce
In my main.js:
I am getting this result when I analyze my vendor bundle:
In vue-chart-3/dist/components.js I see this (line 7 for me):
const chart_js_1 = require("chart.js");
So is it possible vue-chart-3 isn't using tree shaking?
Version of
vue-chart-3
v3.0.9
Version of Vue
3.2.29