Skip to content
This repository was archived by the owner on Jan 16, 2018. It is now read-only.

fix the error of loading loader on windows #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/LoadersList.js
Original file line number Diff line number Diff line change
@@ -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;
};
};