Replies: 2 comments
-
|
I think this happens because it's a runtime condition check, and vite cannot know the value of the condition at build time, thus includes all the default imports. Here we either use the custom react-echarts/src/utils/chart-init.ts Line 53 in e2ec79f
react-echarts/src/utils/chart-init.ts Lines 4 to 17 in e2ec79f So even if you supply a custom This package will need a slight re-org to allow better configuration of diff --git a/node_modules/@kbox-labs/react-echarts/dist/index.mjs b/node_modules/@kbox-labs/react-echarts/dist/index.mjs
index 615d5d5..cfa5ee6 100644
--- a/node_modules/@kbox-labs/react-echarts/dist/index.mjs
+++ b/node_modules/@kbox-labs/react-echarts/dist/index.mjs
@@ -40,7 +40,7 @@ function initializeECharts(container, options) {
}
async function setupECharts(container, options) {
if (!container) return;
- const useOpts = options.use || await getGlobalUse();
+ const useOpts = options.use;
echartsUse(useOpts);
return initializeECharts(container, options);
} |
Beta Was this translation helpful? Give feedback.
-
|
Hi @badsyntax! Thanks for taking a look into this 🙏 What do you think if we remove the
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
We are using
react-echartswith Vite and I wanted to look into theuseprop to reduce bundle size, but nothing I do seems to have an effect on the bundle size.Do you happen to have an example of a setup that successfully tree-shakes modules that are not in use? The result could be seen with https://github.com/KusStar/vite-bundle-visualizer
If not, I'll build a minimal repro case and see if I can share that. Thank you!!
Beta Was this translation helpful? Give feedback.
All reactions