Skip to content

Commit d2f579c

Browse files
TelokisSpaceK33z
authored andcommitted
Support for array of contentBase (#832)
Updated the type checking of `contentBase` for `webpack-dev-server.js` so that it can handle multiple `content-base` arguments.
1 parent aabeeaa commit d2f579c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/webpack-dev-server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ function processOptions(wpOpt) {
247247
if(options.contentBase === undefined) {
248248
if(argv["content-base"]) {
249249
options.contentBase = argv["content-base"];
250-
if(/^[0-9]$/.test(options.contentBase))
250+
if(Array.isArray(options.contentBase)) {
251+
options.contentBase = options.contentBase.map(function(val) {
252+
return path.resolve(val);
253+
});
254+
} else if(/^[0-9]$/.test(options.contentBase))
251255
options.contentBase = +options.contentBase;
252256
else if(!/^(https?:)?\/\//.test(options.contentBase))
253257
options.contentBase = path.resolve(options.contentBase);

0 commit comments

Comments
 (0)