Skip to content

Commit

Permalink
allow CORS on webpack-dev-server (#11325)
Browse files Browse the repository at this point in the history
* allow CORS on webpack-dev-server

* re-position header config on webpackDevServer config
  • Loading branch information
hasanayan committed Sep 22, 2021
1 parent 63bba07 commit 50ea5ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react-scripts/config/webpackDevServer.config.js
Expand Up @@ -44,6 +44,11 @@ module.exports = function (proxy, allowedHost) {
// Note: ["localhost", ".localhost"] will support subdomains - but we might
// want to allow setting the allowedHosts manually for more complex setups
allowedHosts: disableFirewall ? 'all' : [allowedHost],
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
'Access-Control-Allow-Headers': '*',
},
// Enable gzip compression of generated files.
compress: true,
static: {
Expand Down

0 comments on commit 50ea5ad

Please sign in to comment.