yarn run build報錯Component is not found in path 「npm/taro-ui/dist/weapp/components/rate/index「

taro小程序yarn run dev:weapp正常 yarn run build:weapp報錯如下
在這裏插入圖片描述

查找許久得出以下解決方法
production 模式下 taro-ui 組件代碼被當成副作用移除了, 可以加上 sideEffect 配置來解決

prod.js內添加
在這裏插入圖片描述

親測可用,希望可以幫助到被此問題困擾的小夥伴~ 溜~~~👋