Skip to content

fix: enable environments#421

Closed
joshuaellis wants to merge 1 commit into
module-federation:mainfrom
joshuaellis:fix/enable-environments
Closed

fix: enable environments#421
joshuaellis wants to merge 1 commit into
module-federation:mainfrom
joshuaellis:fix/enable-environments

Conversation

@joshuaellis

Copy link
Copy Markdown
Contributor

Description

Moves build-mode resolution of shared dependencies and remote modules from global config.resolve.alias entries to per-environment resolveId hooks. Previously, aliases registered in the config hook leaked into all Vite environments. In a multi-environment build, even the client environment would route shared deps like defu through __loadShare__ proxies. The fix keeps aliases for dev mode (where resolveId can't interfere with Vite pre-bundling) but replaces them in build mode with enforce: 'pre' resolveId plugins that return syntheticNamedExports directly, making them compatible with applyToEnvironment scoping.

Related PRs

@joshuaellis joshuaellis marked this pull request as draft February 19, 2026 19:56
@joshuaellis joshuaellis force-pushed the fix/enable-environments branch from fac4780 to 0c16953 Compare February 20, 2026 08:42

@gioboa gioboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joshuaellis
is this PR still valid?

@joshuaellis

Copy link
Copy Markdown
Contributor Author

Thanks @joshuaellis is this PR still valid?

Not sure, i'lll need to test the new version of the lib and get back to you on that.

@gioboa

gioboa commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

I see, so let's close this one, there are a lot of conflicts too.
Thanks for your support 💪

@gioboa gioboa closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants