Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .changeset/fix-alias-aware-consume-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@module-federation/enhanced': patch
---

fix(enhanced): ConsumeSharedPlugin alias-aware and virtual resource handling

- Skip `data:` (virtual) resources in `afterResolve` and `createModule` so webpack's scheme resolver handles them (fixes container virtual-entry compile failure)
- Broaden alias-aware matching in `afterResolve` to include deep-path shares that start with the resolved package name (e.g. `next/dist/compiled/react`), ensuring aliased modules are consumed from federation when configured
- Avoid converting explicit relative/absolute requests into consumes to preserve local nested resolution (fixes deep module sharing version selection)
- Keep prefix and node_modules suffix matching intact; no behavior change there

These changes restore expected behavior for:
- Virtual entry compilation
- Deep module sharing (distinct versions for nested paths)
- Alias-based sharing (Next.js compiled React)

1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"useDaemonProcess": false,
"targetDefaults": {
"build": {
"inputs": ["production", "^production"],
Expand Down
Loading