Accomodated for change to Loader API in Webpack 2

issue#213
This commit is contained in:
Alexander Wesolowski 2016-02-10 01:23:06 -08:00
parent 99a8d7e4fd
commit 6818eedc2d
1 changed files with 2 additions and 1 deletions

View File

@ -9,7 +9,8 @@ module.exports = function (source) {
this.cacheable();
}
var allLoadersButThisOne = this.loaders.filter(function (loader) {
return loader.module !== module.exports;
// Loader API changed from `loader.module` to `loader.normal` in Webpack 2.
return (loader.module || loader.normal) !== module.exports;
});
// This loader shouldn't kick in if there is any other loader
if (allLoadersButThisOne.length > 0) {