Skip to content

Commit be9efda

Browse files
committed
Allow using no content base with --no-content-base flag
Fixes #464
1 parent 4a01611 commit be9efda

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bin/webpack-dev-server.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ yargs.options({
8585
},
8686
"content-base": {
8787
type: "string",
88+
default: process.cwd(),
8889
describe: "A directory or URL to serve HTML content from.",
8990
group: RESPONSE_GROUP
9091
},
@@ -188,8 +189,6 @@ function processOptions(wpOpt) {
188189
options.contentBase = {
189190
target: argv["content-base-target"]
190191
};
191-
} else if(!options.contentBase) {
192-
options.contentBase = process.cwd();
193192
}
194193

195194
if(!options.stats) {
@@ -267,7 +266,7 @@ function processOptions(wpOpt) {
267266
console.log("webpack result is served from " + options.publicPath);
268267
if(Array.isArray(options.contentBase))
269268
console.log("content is served from " + options.contentBase.join(", "));
270-
else
269+
else if (options.contentBase)
271270
console.log("content is served from " + options.contentBase);
272271
if(options.historyApiFallback)
273272
console.log("404s will fallback to %s", options.historyApiFallback.index || "/index.html");

0 commit comments

Comments
 (0)