未捕获错误:共享模块不可用于急切消费:webpack/sharing/consume/default/vue/vue module-federation Vue3-in-Vue2

问题描述 投票:0回答:1

问题: Vue3 组件如何在 Vue2 应用程序中使用,带有 module-federation。有人需要它,不知何故。

错误: 未捕获错误:共享模块不可用于急切消费:webpack/sharing/consume/default/vue/vue

希望: Vue3 组件可以在 Vue2 应用程序中使用,通过模块联合。

vue.js webpack
1个回答
0
投票

public/index.html:- 添加脚本标签

<!DOCTYPE html>
<html lang="">

<head>
  <meta charset="utf-8">
  <meta name="referrer" content="no-referrer">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link rel="icon" id="faviconLink" href="static/img/favicon.ico">
    <script src="http://localhost:3000/assets/remoteEntry-app3.js"></script>
</head>

  <body>
    <div id="app"></div>
  </body>
</html>
© www.soinside.com 2019 - 2024. All rights reserved.