apache / apache/echarts

[Bug] echarts cdn方式下,vite打包 后 有重复代码

Open
#20,629 3 comments 0 reactions 0 assignees View on GitHub
bug missing-demo pending waiting-for: author
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.4.3

### Link to Minimal Reproduction

https://echarts.apache.org/handbook/zh/basics/release-note/v5-upgrade-guide/

### Steps to Reproduce

vue3 + vite 项目 使用cdn方式引入echarts.esm.js

``` vite代码
rollupOptions: {
external: ["vue",'echarts','echarts/lib/echarts'],
```

### Current Behavior

使用cdn方式引入echarts.esm.js,
但是打包时还是会有echarts的内容,
全部都是lib模块下的。有无办法优化?
![image](https://github.com/user-attachments/assets/dddaa38a-ccd0-46d0-96e5-9b2621869016)

### Expected Behavior

期望打包后不包含echarts lib

### Environment

```markdown
node 18
vite 5.4.8
echarts 5.4.3
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.