diff --git a/lib/LoadersList.js b/lib/LoadersList.js index a5d7eb3..d2590a4 100644 --- a/lib/LoadersList.js +++ b/lib/LoadersList.js @@ -2,6 +2,8 @@ MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ +var OS = require('os'); + function LoadersList(list) { this.list = list || []; this.list.forEach(function(element) { @@ -19,6 +21,7 @@ function regExpAsMatcher(regExp) { function asMatcher(test) { if(typeof test === "string") { + test = /windows/i.test(OS.type()) ? test.split('/').join('\\') : test; return regExpAsMatcher(new RegExp("^"+test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"))); } else if(typeof test === "function") { return test; @@ -93,4 +96,4 @@ LoadersList.prototype.matchObject = function matchObject(str, obj) { if(obj.exclude) if(this.matchPart(str, obj.exclude)) return false; return true; -}; \ No newline at end of file +};