Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite 打包 echarts 采用 cdn 引入后,还是打包成了本地文件。 #59

Open
China-xiaoFang opened this issue Oct 3, 2024 · 0 comments

Comments

@China-xiaoFang
Copy link

当我使用 echarts 的时候,我尝试使用 cdn 引入,进行 vite 打包配置。
但是最终发现,echarts 还是打包进了我的本地文件。

通过 rollup-plugin-visualizer 可以直观的看到所有打包后的依赖文件。

这是不采用 cdn 引入,打包后的分析文件。
image

这是采用 cdn 引入,打包后的分析文件。
image

可以看出它们并没有任何的区别。

最小的实现仓库地址:https://stackblitz.com/edit/vite-plugin-cdn-import-echarts-error

pnpm build -> 之后,在 dist/static/js 文件夹中即可看到打包后的文件。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant