Closed juan-rvty closed 1 month ago
Would you create a minimal reproduction of what your use case so we better understand it. Maybe it would be easier to discuss with a PR to show how the implementation looks. But as we stated in the other open issues, the complexity of supporting a relative base during development was too much to justify the feature.
https://github.com/module-federation/vite/issues/52 This problem also occurs in the module-federation scenario. The host port is 5175, the remote port is 5176, but the remote resource uses /
@patak-dev @yyx990803 FYI, there has been a very good progress with Module Federation support for Vite over last month here (check the new-config
branch and examples there). Here @zhangHongEn and @gioboa have used recently released Module Federation 2 which is bundler agnostic. So this hopefully will significantly help efforts to get Vite Module Federation support in place. This approach saves us from implementing MF from scratch and offers consistent behaviour across bundlers, which is especially important in case of MF as modules are often built with different bundlers and it is important to have compatible implementation across. Also, RsPack and NextJs are using this approach to get there MF implemented.
Since MF has been one of the few areas where Vite was not up to speed, it will be great to work with them in order to get first class Module federation support in Vite
@zhangHongEn In your case, won't server.origin: 'https://localhost:5176'
work?
@zhangHongEn In your case, won't
server.origin: 'https://localhost:5176'
work?
server.origin
solved my problem
I'm closing this issue as the author has not provided any additional details for a while and the module federation one is covered by server.origin
. Feel free to create a new issue with more details if it's still something that is good to have.
Description
Make
supported in the dev server.
Use case:
Our app always runs inside iframes, even during development. This relates to: https://github.com/vitejs/vite/issues/14105 but in my case the uri is not known before hand. Also relates to: https://github.com/vitejs/vite/issues/11142
Suggested solution
Allow relative base path in dev mode.
Alternative
No response
Additional context
No response
Validations