Skip to content

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

@superchangme

Description

@superchangme

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

    rollupOptions: {
      external: ["vue",'echarts','echarts/lib/echarts'],

Current Behavior

使用cdn方式引入echarts.esm.js,
但是打包时还是会有echarts的内容,
全部都是lib模块下的。有无办法优化?
image

Expected Behavior

期望打包后不包含echarts lib

Environment

node 18
 vite 5.4.8
 echarts 5.4.3

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmissing-demoThe author should provide a demo.pendingWe are not sure about whether this is a bug/new feature.waiting-for: author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions