diff --git a/lib/utils.js b/lib/utils.js index 788d0cf..9d46e9a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -183,8 +183,10 @@ function getCanonicalNamePlain(loader, normalized, isPlugin) { return p; // support trailing / in paths rules - else if (normalized.substr(0, curPath.length - 1) == curPath.substr(0, curPath.length - 1) && (normalized.length < curPath.length || normalized[curPath.length - 1] == curPath[curPath.length - 1]) && curPath[curPath.length - 1] == '/') - return p.substr(0, p.length - 1) + (normalized.length > curPath.length ? '/' + normalized.substr(curPath.length) : ''); + else if (normalized.substr(0, curPath.length - 1) == curPath.substr(0, curPath.length - 1) && + (normalized.length < curPath.length || normalized[curPath.length - 1] == curPath[curPath.length - 1]) && + curPath[curPath.length - 1] == '/') + return p + normalized.substr(curPath.length); } // then wildcard matches