0

I am using angular 11 with webpack 5 module federation. I have plans to expose component from remotes.

exposes: {
 "component": ".//src/app/app.component.ts"
}

while importing import {component} from "mfe@component"

I am getting build error "cannot find mmodule "mfe1@component"

how to consume remotely exposed component at design time

Manish
  • 21
  • 8

3 Answers3

0

The path you provided is not correct. ./ is missing in the beginning of component name. change it to as shown below.

exposes: {
      "./component": "./src/app/app.component.ts"
 }
  • 1
    How to consume this component in other project(shell)? I am having 3 micro frontend projects which runs independently. But i want to transfer data between these projects, how to pass? – Kamal Aug 11 '21 at 06:10
0

Did you add the remote configuration in webpack.config.js in shell app ?

 remotes: {
     "mfe1": "http://localhost:5000/remoteEntry.js",
 },
Karthikeyan
  • 183
  • 1
  • 8
0

I think it will work only for standalone components which has support from angular 14 onwards, on previous versions you need to expose the module

Prats
  • 1,745
  • 4
  • 24
  • 28