enhanced-resolve
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -521,2 +521,3 @@ /* | ||
}); | ||
Object.keys(options.alias).forEach(testModule); | ||
var count = paths.length; | ||
@@ -529,10 +530,3 @@ paths.forEach(function(path) { | ||
files = cutExtensions(files, type === "loader" ? options.loaderPostfixes : options.postfixes); | ||
files.forEach(function(file) { | ||
if(file.indexOf(starting) != 0) return; | ||
if(file.length < ending.length || file.lastIndexOf(ending) != file.length - ending.length) return; | ||
results.push({ | ||
insert: file.slice(starting.length, file.length - ending.length), | ||
seqment: file | ||
}); | ||
}); | ||
files.forEach(testModule); | ||
endOne(); | ||
@@ -542,2 +536,10 @@ }); | ||
}); | ||
function testModule(file) { | ||
if(file.indexOf(starting) != 0) return; | ||
if(file.length < ending.length || file.lastIndexOf(ending) != file.length - ending.length) return; | ||
results.push({ | ||
insert: file.slice(starting.length, file.length - ending.length), | ||
seqment: file | ||
}); | ||
} | ||
function endOne() { | ||
@@ -544,0 +546,0 @@ if(--count == 0) { |
{ | ||
"name": "enhanced-resolve", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Offers a async require.resolve function. It's highly configurable.", |
@@ -9,3 +9,7 @@ /* | ||
var options = {}; | ||
var options = { | ||
alias: { | ||
aliasmod: "m1" | ||
} | ||
}; | ||
@@ -106,2 +110,21 @@ var fixtures = path.join(__dirname, "fixtures"); | ||
], | ||
"aliasmod/a*": [ | ||
{ insert: "", seqment: "a", part: "aliasmod/a", result: "aliasmod/a" }, | ||
{ insert: ".js", seqment: "a.js", part: "aliasmod/a.js", result: "aliasmod/a.js" } | ||
], | ||
"aliasmod/*": [ | ||
{ insert: "a", seqment: "a", part: "aliasmod/a", result: "aliasmod/a" }, | ||
{ insert: "a.js", seqment: "a.js", part: "aliasmod/a.js", result: "aliasmod/a.js" }, | ||
{ insert: "b", seqment: "b", part: "aliasmod/b", result: "aliasmod/b" }, | ||
{ insert: "b.js", seqment: "b.js", part: "aliasmod/b.js", result: "aliasmod/b.js" } | ||
], | ||
"aliasm*": [ | ||
{ insert: "od", seqment: "aliasmod", part: "aliasmod", result: "aliasmod" } | ||
], | ||
"aliasmod*": [ | ||
{ insert: "", seqment: "aliasmod", part: "aliasmod", result: "aliasmod" }, | ||
{ insert: "/", seqment: "aliasmod/", part: "aliasmod/", result: "aliasmod/" } | ||
], | ||
"./shortcut*": [ | ||
@@ -108,0 +131,0 @@ { insert: "dir.js", seqment: "shortcutdir.js", part: "./shortcutdir.js", result: "./shortcutdir.js" } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76906
2359