vite + vue3 在小程序下编译报错,h5无问题,报错信息如下:
[vite]: Rollup failed to resolve import "@dcloudio/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue" from "/Users/chenzhi/Documents/vue-project/weapp-property/src/layouts/default.vue?vue&type=script&setup=true&lang.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
看了一下@dcloudio/uni-ui 文件结构,下面根本没有lib文件夹,导致easycom导入失败!
npm上最新版本是没有编译过的个组件库
- build.rollupOptions.external 要么加,让Rollup额外编译
- 要么降版本1.4.27
如果我的这个问题是普遍存在的话,官网最好更新一下文档吧!
0 个回复