-
Notifications
You must be signed in to change notification settings - Fork 87
feat: add ignoreOrigin option #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ignoreOrigin option #290
Conversation
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.originwindow.origin
|
I created a basic example for this:
It shows the remote with the URL of the host, not the remote as expected |
|
The way I'm using module-federation is to dynamic load remotes to use as a plugin system for the react host app. This plugin system gets the default of the remote and call it passing some parameter to the plugin initialize. This change is important to give a nice developer experience when developing plugins to the app (allowing it to hot reload with this PR: vitejs/vite-plugin-react#420 ) |
|
Fixed unit test for this |
|
@gioboa , do you think this is a mergeable change? I'm waiting on this to be able to release the Actual Budget plugin system so it starts with a nice developer experience (I'm a maintainer of AB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lelemm it looks good to me
window.origin|
@lelemm A new release with this feat is out now. 👏 |


I have a use case that I need to run the remote in dev mode but keep attaching it to the host.
This original line
const origin = window ? window.origin : "//${host}:${viteConfig.server?.port}"prevents me from using the remote this way, because it tries to load the remote from the host url.
Adding this new parameter makes it possible to do this use case and keep the original behavior.