Tencent / wepy

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

全局配置使用组件 组件未被打包进入weapp内2.0 #2559

Open chenyu445 opened 4 years ago

chenyu445 commented 4 years ago

[阅读完后请在提交的issue中删除以上内容,包括分割线]()

DELETE THE INFORMATION ABOVE(INCLUDE THE SEPARATION LINE) BEFORE YOU OPEN AN ISSUE


Description

在 app.wpy中配置全局组件的了以后,components没有被打包到weapp里面,导致在页面调用组件的时候出现找不到组件的错误

[Description of the issue]

Environment

Reproduce

[如何重现问题] app.wpy内配置组件信息,然后再index页面使用组件

usingComponents:{
    panel: "~@/components/panel"
  }

运行

npm run dev

查看开发工具,报错


jsEnginScriptError
Component is not found in path "pages/..\components\panel" (using by "pages/index");onAppRoute
Error: Component is not found in path "pages/..\components\panel" (using by "pages/index")

### Observed Results

  [实际表现]
  无法加载组件且报错,查看打包后的weapp文件夹,发现没有components文件夹,及组件没有被打包进入weapp

### Expected Results

  [期望表现]

  [Expected Results]
  组件被打包进入weapp文件夹,组件可以正常使用
#2599 
yokingma commented 4 years ago

+1 wepy-cli version: [2.0.0-alpha.20] wepy version: [2.0.0-alpha.14]

sinceow commented 4 years ago

+1 wepy-cli version: [2.0.0-alpha.28] wepy version: [2.0.0-alpha.16]

truexu0529 commented 4 years ago

删除weapp,重新build下就可以