Skip to content
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

allow CORS on webpack-dev-server #11325

Merged

Conversation

hasanayan
Copy link
Contributor

working with module federation locally in development mode requires CORS. This PR enables that.

@lomocc
Copy link

lomocc commented Aug 26, 2021

maybe you can set .env to --disable-web-security

BROWSER=google chrome
BROWSER_ARGS=--user-data-dir="/tmp/chrome_dev_test" --disable-web-security

@hasanayan
Copy link
Contributor Author

maybe you can set .env to --disable-web-security

BROWSER=google chrome
BROWSER_ARGS=--user-data-dir="/tmp/chrome_dev_test" --disable-web-security

Yes, this is a working workaround, one could also use craco to do this but we are working on making create-react-app module-federation ready out of the box.

@raix
Copy link
Contributor

raix commented Sep 3, 2021

@hasanayan agree we might need this (just looking at the module federation examples)
Maybe we should move the header config just bellow "allowedHosts" so "security" items are next to eachother (my OCD speaking, feel free to push back :) )

@raix raix added this to the 5.0 milestone Sep 3, 2021
@hasanayan
Copy link
Contributor Author

@hasanayan agree we might need this (just looking at the module federation examples)
Maybe we should move the header config just bellow "allowedHosts" so "security" items are next to eachother (my OCD speaking, feel free to push back :) )

I feel ya :) will update the PR soon

@hasanayan
Copy link
Contributor Author

@raix done :)

Copy link
Contributor

@mrmckeb mrmckeb left a comment

Choose a reason for hiding this comment

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

I'm OK with this change @iansu, as it's only the dev server anyway. WDYT?

@iansu iansu merged commit 50ea5ad into facebook:main Sep 22, 2021
@iansu
Copy link
Contributor

iansu commented Sep 22, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants