vite-plugin-federation icon indicating copy to clipboard operation
vite-plugin-federation copied to clipboard

Mix exposes and remotes on the same module

Open ChristPetitjean opened this issue 3 years ago • 2 comments

Versions

  • originjs: 1.1.4
  • node: 14.17.0

Reproduction

go to: https://github.com/ChristPetitjean/BUG-vite-plugin-federation

1. Auth module

run npm run build. It should build fine run npm run serve. It should serve the module on port 5002 you can navigate to http://localhost:5002 to confirm the site starts

2. Header module

run npm run build. It should build fine run npm run serve. It should serve the module on port 5001 you can navigate to http://localhost:5001 to confirm the site starts

3. Portal module

run npm run dev. It should run the portal and the header should be displayed Here you can notice a thing. The vue-router is not shared (visible because no link are highlighted) whereas they were highlighted when runing http://localhost:5001 directly. But that is not the major issue here.

Steps to reproduce

To reproduce switch to the branch: bug-remotes-exposes: https://github.com/ChristPetitjean/BUG-vite-plugin-federation/tree/bug-remotes-exposes Or open the pull request to see differences: https://github.com/ChristPetitjean/BUG-vite-plugin-federation/pull/1

What is Expected?

Header module is able to build

What is actually happening?

When activating auth module in header (so header have remotes and exposes configured), it will not build at all.

ChristPetitjean avatar Apr 13 '22 17:04 ChristPetitjean

I probably know what the reason for the failure is, because federation's shared only looks under node_modules, not according to its own remotes, so it can't find auth modules image

Jiannan-dev avatar Apr 19 '22 02:04 Jiannan-dev

This should be one of the subsequent features to be implemented, I'll add it to the plan first, thanks

Jiannan-dev avatar Apr 19 '22 02:04 Jiannan-dev

Hello @ruleeeer. Any progress on it? Because it's really must to have, because of migrating big project from webpack to vite

dschewchenko avatar Jan 10 '23 11:01 dschewchenko

Any news @ruleeeer ? I see it in Roadmap H2 2022 but as we are now 2023, do you have some visibility ?

ChristPetitjean avatar Jan 30 '23 13:01 ChristPetitjean