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内添加
在这里插入图片描述

亲测可用,希望可以帮助到被此问题困扰的小伙伴~ 溜~~~👋