aurelia / aurelia/webpack-plugin
[Webpack 5] Module Federation plugin does not work
- Dominant language
- TypeScript
- Stars
- 89
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
**I'm submitting a bug report**
* **Library Version:**
5.0.0
**Please tell us about your environment:**
* **Operating System:**
Windows 10
* **Node Version:**
10.18.1
* **NPM Version:**
6.13.4
* **JSPM OR Webpack AND Version**
webpack 5.42.0
* **Browser:**
Chrome 91.0.4472.124 (Official Build) (64-bit)
* **Language:**
TypeScript 4.2.4
**Current behavior:**
Once configuring Webpack Federation Module for two Aurelia projects (one is a host and another one is a remote component), the host is not requesting for `remoteEntry.js` from the remote component.
Both of the projects have a clean setup built using `au new` and they are migrated to Webpack 5.
Host's Module Federation plugin config:

Remote Component's Module Federation plugin config:

Remote Component's function definition:

Host using Remote Component's function:

Build has succeeded, but the issue occurs during runtime. `remoteEntry.js` is not issued by the host:

However it has been successfully generated on the remote component side:

You can find all code in this repo: https://github.com/damian131/aurelia-module-federation
**Expected/desired behavior:**
`remoteEntry.js` file is requested by the host which eventually ends up with remote component's function being called on the host side.
**What is the motivation / use case for changing the behavior?**
Having ability to use Module Federation plugin within Aurelia apps and taking advantage from micro-frontend architecture.
Contributor guide
Research direction
Clone the linked aurelia-module-federation reproduction and start by running the host and remote Aurelia projects with their shown Module Federation configurations. Inspect the browser network activity and generated remoteEntry.js; done means the host requests remoteEntry.js and invokes the remote component function at runtime.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100