Home  >  Q&A  >  body text

Vue 3 + Module Federation: Implementing modular Vue 3 applications

<p>I'm trying to build a simple micro frontend example using Vue3 and Module Federation, but I'm running into conflict issues. </p> <p>I have the code here: https://github.com/ghalex/mf-example</p> <p>There are only two micro frontends: </p> <ul> <li>Container (Vue3)</li> <li>Authorization (Vue3)</li> </ul> <p>My problem is that when I import the App.vue component: </p> <pre class="brush:js;toolbar:false;">// index.js - in container import App from './components/App.vue' </pre> <pre class="brush:js;toolbar:false;">// indexAuth.js - in auth import App from './components/App.vue' </pre> <p>When loading the module into the container in the <strong>auth</strong> module, the App.vue component was overwritten. </p> <p>Are there any webpack settings I'm missing to ensure each component is loaded individually? </p>
P粉448346289P粉448346289419 days ago636

reply all(1)I'll reply

  • P粉476046165

    P粉4760461652023-08-27 19:25:28

    I found the problem, it is a bug of webpack-dev-server v4. I downgraded to v3 and everything is working fine.

    reply
    0
  • Cancelreply