worktile / ngx-planet

🚀🌍🚀A powerful, reliable, fully-featured and production ready Micro Frontend library for Angular.
http://planet.ngnice.com
MIT License
539 stars 66 forks source link

无限循环加载主应用的js #282

Closed my5201314zwl closed 1 year ago

my5201314zwl commented 1 year ago

Describe the bug A clear and concise description of what the bug is. 测试demo,使用ng serve 分别启动main-app和sub-app。 main-app能显示sub-app内容,但是无限循环加载主应用。 见附件

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

micro-test.zip

why520crazy commented 1 year ago
  1. sub-app "start" 改为 "ng serve --serve-path=/static/sub-app/",
  2. main appregisterApps sub-app 注册子应用的时候设置 resourcePathPrefix 为 'http://localhost:3001/static/sub-app/'

Angular CLI 在某个版本的本地 Server 默认使用这个 serve-path 作为服务的地址,如果没有指定,主应用和子应用都是监听了同一个 Socket 服务,一直在 Reload 加载