如何使用React共享模块联合会中常见的公用事业文件/功能,常见的CSS或设计系统?

发布于 2025-01-21 16:56:32 字数 744 浏览 3 评论 0原文

我是模块联合会的新手,我正在尝试将我的整体项目联合到多个微观前端,但是我有一些通用的实用程序功能,即整个应用程序中使用的全局CSS。我已经在线搜索,但没有得到任何结果。 我知道我们有可以使用实用程序模块的单个SPA。 in Single-spa global css 而且,在Angular中,我们拥有的模块联合会有: angular模块联合会

但是我特别需要使用 Module Federation React 在不使用任何其他第三方库中使用 Module Federation 仅在MFES上共享的通用实用程序和全局CSS或设计系统,

我可以想到两个 可能性

  1. 使用单个SPA与模块联合使用的
  2. ,并创建任何MFE可以使用的通用MFE。

但是,不确定这是否是最优化的方法,也请让我在其他任何方法上。

I am new to module federation , and I am trying to federate my monolith project into multiple Micro frontends but I have some common utility functions , global css that are being used across the application . I have searched online but did not get any result .
I know we have single-spa where we can use utility module .
global css in single-spa
And also in angular we have with module federation we have :
angular module federation

But I specifically need common utility functions and global css or design systems that can be shared across the MFEs only using module federation with react without using any other third party library

I can think of two possibilities

  1. Using single-spa with module federation and
  2. Create a common MFE which any MFE can use .

But not sure if this would be the most optimised way also kindly let me if any other ways are there.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文