@@ -90,7 +90,7 @@ CORS Issues
90
90
-----------
91
91
92
92
If you experience issues related to CORS (Cross Origin Resource Sharing), set
93
- the `` firewall `` option:
93
+ the following option:
94
94
95
95
.. code-block :: javascript
96
96
@@ -101,11 +101,13 @@ the ``firewall`` option:
101
101
// ...
102
102
103
103
.configureDevServerOptions (options => {
104
- options .firewall = false ;
104
+ options .allowedHosts = ' all' ;
105
+ // in older Webpack Dev Server versions, use this option instead:
106
+ // options.firewall = false;
105
107
})
106
108
107
- Beware that ` it's not recommended to disable the firewall `_ in general, but
108
- here it's required to solve the CORS issue.
109
+ Beware that this is not a recommended security practice in general, but here
110
+ it's required to solve the CORS issue.
109
111
110
112
Hot Module Replacement HMR
111
113
--------------------------
@@ -123,5 +125,4 @@ your page. HMR works automatically with CSS (as long as you're using the
123
125
CSS. That is no longer needed.
124
126
125
127
.. _`webpack-dev-server` : https://webpack.js.org/configuration/dev-server/
126
- .. _`it's not recommended to disable the firewall` : https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
127
128
.. _`4.0 CHANGELOG` : https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md#400-beta0-2020-11-27
0 commit comments