Skip to content

Commit 50ea5ad

Browse files
authoredSep 22, 2021
allow CORS on webpack-dev-server (#11325)
* allow CORS on webpack-dev-server * re-position header config on webpackDevServer config
1 parent 63bba07 commit 50ea5ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎packages/react-scripts/config/webpackDevServer.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ module.exports = function (proxy, allowedHost) {
4444
// Note: ["localhost", ".localhost"] will support subdomains - but we might
4545
// want to allow setting the allowedHosts manually for more complex setups
4646
allowedHosts: disableFirewall ? 'all' : [allowedHost],
47+
headers: {
48+
'Access-Control-Allow-Origin': '*',
49+
'Access-Control-Allow-Methods': '*',
50+
'Access-Control-Allow-Headers': '*',
51+
},
4752
// Enable gzip compression of generated files.
4853
compress: true,
4954
static: {

0 commit comments

Comments
 (0)
Please sign in to comment.