-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Bug] tree shaking 没有把未被使用的图片删除掉 #12881
Comments
官方的回复是等不到了,分享我自己的解决方案,希望对其他人能有帮助。
|
动态拼接的图片引用呢? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happens?
有个组件 ComponentA,其样式文件引用了图片资源。这个组件未被使用,tree shaking 之后组件的 js 和 css 代码都被删除了,但仅被 ComponentA 所引用的图片却出现在了产物当中。
Mini Showcase Repository(REQUIRED)
查看这个项目
How To Reproduce
Steps to reproduce the behavior: 1. 2.
执行 build 命令,发现产物中存在未被使用的图片。
Expected behavior 1. 2.
未被使用的图片不应该出现中构建产物中。
Context
The text was updated successfully, but these errors were encountered: