Tencent / wepy

小程序组件化开发框架
https://wepyjs.gitee.io/wepy-docs/
Other
22.5k stars 3.05k forks source link

wepy2使用module:../libs/xxx引入本地的三方组件报错 #1922

Open huixisheng opened 5 years ago

huixisheng commented 5 years ago

Description

使用npm安装的三方组件正常,如果拷贝node_modules的目录到本地开发目录,使用相对路径引用会导致路径解析问题

Environment

wepy2

Reproduce

<config>
{
  usingComponents: {
    'van-badge': 'module:../libs/vant-weapp/dist/badge/index',
 }
}
</config>

Observed Results

image

Expected Results

正常运行

Gcaufy commented 5 years ago

如果不存在于 node_modules 目录, 就不需要添加 module: 前缀的。

huixisheng commented 5 years ago

如果是用小程序原生封装的组件(该组件不稳定,需要随时修改,暂时没放入node_modules)是要如何引用?