Skip to content

Commit 61b46ba

Browse files
committed
Deprecate contentBase with a URL or port
This was originally introduced before the `proxy` option was a thing. Now we have the `proxy` option, it is better to use that instead since it is way more powerful and can do the same.
1 parent f779ef8 commit 61b46ba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ function Server(compiler, options) {
239239
app.get("*", express.static(item));
240240
});
241241
} else if(/^(https?:)?\/\//.test(contentBase)) {
242+
console.log("Using a URL as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.");
243+
console.log('proxy: {\n\t"*": "<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
242244
// Redirect every request to contentBase
243245
app.get("*", function(req, res) {
244246
res.writeHead(302, {
@@ -247,6 +249,8 @@ function Server(compiler, options) {
247249
res.end();
248250
});
249251
} else if(typeof contentBase === "number") {
252+
console.log("Using a number as contentBase is deprecated and will be removed in the next major version. Please use the proxy option instead.");
253+
console.log('proxy: {\n\t"*": "//localhost:<your current contentBase configuration>"\n}'); // eslint-disable-line quotes
250254
// Redirect every request to the port contentBase
251255
app.get("*", function(req, res) {
252256
res.writeHead(302, {

0 commit comments

Comments
 (0)