Skip to content

Commit 40b0fea

Browse files
committed
re-position header config on webpackDevServer config
1 parent 5e7dba4 commit 40b0fea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-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: {
@@ -123,10 +128,5 @@ module.exports = function (proxy, allowedHost) {
123128
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
124129
devServer.app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
125130
},
126-
headers: {
127-
'Access-Control-Allow-Origin': '*',
128-
'Access-Control-Allow-Methods': '*',
129-
'Access-Control-Allow-Headers': '*',
130-
},
131131
};
132132
};

0 commit comments

Comments
 (0)