Angular微前端无限刷新

发布于 2025-01-16 03:23:28 字数 340 浏览 0 评论 0原文

我正在尝试使用 webpack 模块联合构建 Angular Micro 前端。我已将所有自定义 webpack 文件添加到应用程序中。所有应用程序都构建良好。另外,当我尝试从各自的路径访问各个微前端时,它工作正常,但是当我尝试从 shell 应用程序访问各个微前端时,它会遇到无限刷新。我正在关注这个文章作为参考。

不知道除了本文中提到的之外我还需要做什么。任何帮助都会得到帮助。

I am trying to build Angular Micro frontend using webpack module federation. I have added all custom webpack files to the application. All applications builds fine. Also, When I try to access the individual micro frontend from their respective path then it is working fine but when I try to access individual micro frontend from the shell application then it is running into infinite refresh. I am following this article as a reference.

Not sure what else I need to do other than mention here in this article. Any help will appriciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把回忆走一遍 2025-01-23 03:23:28

我找到了防止实时重新加载问题的解决方案。您需要将 publicHost 属性添加到 angular.json 中的远程配置中。因此,调整project/remote-project-name/architect/serve/options部分如下:

[...] "options": {
+   "publicHost": "http://localhost:3000",
    "port": 3000,
    "extraWebpackConfig": "projects/mfe1/webpack.config.js" } [...]

I found the solution to prevent issues with live reloads. You need to add a publicHost property to your remote's configuration in your angular.json. Hence, adjust the section project/remote-project-name/architect/serve/options as follows:

[...] "options": {
+   "publicHost": "http://localhost:3000",
    "port": 3000,
    "extraWebpackConfig": "projects/mfe1/webpack.config.js" } [...]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文