webpack 的 Tree Shaking 未删除没有被使用的图片,如何解决?
在业务项目 Business 中引用了组件库 Components,使用 webpack 构建,配置了 Tree Shaking 相关属性,未被使用的代码都被删除了,但未被使用的图片却出现在了最终产物中。比如,Components 导出了组件 ComponentA,存在这样的资源引用关系:ComponentA.tsx -> ComponentA.less -> ComponentA.png。ComponentA 未...
1 回答2.8k 阅读