Skip to content

Commit

Permalink
Support for array of contentBase (#832)
Browse files Browse the repository at this point in the history
Updated the type checking of `contentBase` for `webpack-dev-server.js` so that it can handle multiple `content-base` arguments.
  • Loading branch information
Telokis authored and SpaceK33z committed Mar 11, 2017
1 parent aabeeaa commit d2f579c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/webpack-dev-server.js
Expand Up @@ -247,7 +247,11 @@ function processOptions(wpOpt) {
if(options.contentBase === undefined) {
if(argv["content-base"]) {
options.contentBase = argv["content-base"];
if(/^[0-9]$/.test(options.contentBase))
if(Array.isArray(options.contentBase)) {
options.contentBase = options.contentBase.map(function(val) {
return path.resolve(val);
});
} else if(/^[0-9]$/.test(options.contentBase))
options.contentBase = +options.contentBase;
else if(!/^(https?:)?\/\//.test(options.contentBase))
options.contentBase = path.resolve(options.contentBase);
Expand Down

0 comments on commit d2f579c

Please sign in to comment.