Skip to content

allow CORS on webpack-dev-server - #11325

Merged
iansu merged 2 commits into
react:mainfrom
hasanayan:feature/allow-CORS-on-webpack-dev-server
Sep 22, 2021
Merged

allow CORS on webpack-dev-server#11325
iansu merged 2 commits into
react:mainfrom
hasanayan:feature/allow-CORS-on-webpack-dev-server

Conversation

@hasanayan

Copy link
Copy Markdown
Contributor

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

@lomocc

Copy link
Copy Markdown

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
Copy Markdown
ContributorAuthor

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

raix commented Sep 3, 2021

Copy link
Copy Markdown
Contributor

@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 :) )

@raixraix added this to the 5.0 milestone Sep 3, 2021
@hasanayan

Copy link
Copy Markdown
ContributorAuthor

@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
Copy Markdown
ContributorAuthor

@raix done :)

raix
raix approved these changes Sep 3, 2021

@mrmckebmrmckeb left a comment

Copy link
Copy Markdown
Contributor

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 react:mainSep 22, 2021
@iansu

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for freeto 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

@hasanayan@lomocc@raix@iansu@mrmckeb@facebook-github-bot