Skip to content

Commit 5258ca2

Browse files
committed
fixed LoaderList matching to be "or" again
fixed webpack#1947 webpack#1889
1 parent b348d60 commit 5258ca2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/LoadersList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function asMatcher(test) {
3131
// create an array of match functions
3232
var matchers = test.map(asMatcher);
3333
return function(str) {
34-
return matchers.every(function(matcher) {
34+
return matchers.some(function(matcher) {
3535
return matcher(str);
3636
});
3737
};

test/LoaderList.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe("LoaderList", function() {
9292
],
9393
loader: 'css'
9494
}]);
95-
(loader.match('style.css')).should.eql([]);
95+
(loader.match('style.css')).should.eql(['css']);
9696
});
9797
it('should not match if include does not match', function() {
9898
var loader = new LoadersList([{

0 commit comments

Comments
 (0)