Resolving Duplicate Module Loading with Vite-Plugin-Federation in a Project with Interdependent Modules #205
Unanswered
feifeilian
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using the vite-plugin-federation plugin, a project references modules A and B , with B also importing module A through webpack mode, and then we encounter an issue where module A is loaded twice. This can lead to the context being overwritten during initialization. How can this issue be resolved?

使用vite-plugin-federation插件,该项目引用A和B,通过vite插件引入webpack的形式,其中B又引入了A的模块,通过webpack的模式,此时启动该项目,发现A加载了两遍,这样初始化时contex就会被覆盖,并且会偶尔触发初始化两遍的错误报出。求看下有没有解?
Beta Was this translation helpful? Give feedback.
All reactions