Skip to content

Commit 2639edc

Browse files
committed
Remove using contentBase a proxy feature.
This was deprecated since 1.x Fixes #582
1 parent 6dbf666 commit 2639edc

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

bin/webpack-dev-server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ function processOptions(wpOpt) {
267267
console.log("webpack result is served from " + options.publicPath);
268268
if(Array.isArray(options.contentBase))
269269
console.log("content is served from " + options.contentBase.join(", "));
270-
else if(typeof options.contentBase === "object")
271-
console.log("requests are proxied to " + options.contentBase.target);
272270
else
273271
console.log("content is served from " + options.contentBase);
274272
if(options.historyApiFallback)

lib/Server.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,18 +211,6 @@ function Server(compiler, options) {
211211
contentBase.forEach(function(item) {
212212
app.get("*", serveIndex(item));
213213
});
214-
} else if(typeof contentBase === "object") {
215-
console.log('Using contentBase as a proxy is deprecated and will be removed in the next major version. Please use the proxy option instead.\n\nTo update remove the contentBase option from webpack.config.js and add this:');
216-
console.log('proxy: {\n\t"*": <your current contentBase configuration>\n}');
217-
// Proxy every request to contentBase.target
218-
app.all("*", function(req, res) {
219-
proxy.web(req, res, contentBase, function(err) {
220-
var msg = "cannot proxy to " + contentBase.target + " (" + err.message + ")";
221-
this.sockWrite(this.sockets, "proxy-error", [msg]);
222-
res.statusCode = 502;
223-
res.end();
224-
}.bind(this));
225-
}.bind(this));
226214
} else if(/^(https?:)?\/\//.test(contentBase)) {
227215
// Redirect every request to contentBase
228216
app.get("*", function(req, res) {
@@ -244,7 +232,7 @@ function Server(compiler, options) {
244232
app.get("*", express.static(contentBase, options.staticOptions), serveIndex(contentBase));
245233
}
246234
}
247-
}.bind(this),
235+
},
248236

249237
middleware: function() {
250238
// include our middleware to ensure it is able to handle '/index.html' request after redirect

0 commit comments

Comments
 (0)