Version
5.2.2
Link to Minimal Reproduction
No response
Steps to Reproduce
I have customized an extension called GLMap
, which can put echarts on my map, but now I can only fully introduce echarts, which will make my project package large.
like this
import * as echarts from "echarts"
// do something, like custom my extension
I saw the expansion mode of Baidu map , which is also full. So I want to know what I should do if I introduce it on demand?
Current Behavior
I'm now introducing it on demand:
import "./GLMap";
import * as echarts from "echarts/core";
import { VisualMapComponent } from "echarts/components";
import { CanvasRenderer } from "echarts/renderers";
echarts.use([VisualMapComponent, CanvasRenderer]);
export default echarts;
Although I feel like I don't use VisualMapComponent
at all
Expected Behavior
Can be introduced on demand
Environment
- OS: Mac M1
- Browser: Chrome lasted
- Framework: native
Any additional comments?
No response
2条答案
按热度按时间elcex8rz1#
Of course, I'm Chinese. In English, I think it might be more friendly in GitHub?
But my English comes from translation software🤪
bfnvny8b2#
楼主解决了吗 我也发现了 我的版本是
"echarts": "^5.3.2",
只需要import * as echarts from 'echarts/core';
就能使用所有功能
压根不用如下配置就能使用所有的 而且引入了如下的跟注释了后大小也没有变化