Skip to content

Commit 4d18f58

Browse files
committed
Merge pull request #374 from BerndWessels/master
Extend contentBase to support array with multiple sources.
2 parents 4a1a3bf + 07b70a3 commit 4d18f58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ function Server(compiler, options) {
197197
if(options.contentBase !== false) {
198198
var contentBase = options.contentBase || process.cwd();
199199

200-
if(typeof contentBase === "object") {
200+
if(Array.isArray(contentBase)) {
201+
contentBase.forEach(function(item, index, array) {
202+
app.get("*", express.static(item), serveIndex(item));
203+
});
204+
} else if(typeof contentBase === "object") {
201205
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:');
202206
console.log('proxy: {\n\t"*": <your current contentBase configuration>\n}');
203207
// Proxy every request to contentBase.target

0 commit comments

Comments
 (0)