if require is aliased, detective incorrectly returns uses of it as dependencies
fresheneesz opened this issue · comments
Billy commented
Eg:
var require = function() {
console.log('test')
}
require("this isn't a dependency")
It should be pretty simple to detect scopes in which require is redefined and exclude requires there.
Jesse McCarthy commented
@fresheneesz No idea about it happening here (I'm guessing unlikely due to performance reasons), but in case you're interested I made an adapation of Detective that does that (taking a big performance hit).
John Firebaugh commented
Another variant:
function(require) {
require("this isn't a dependency");
}
This is in fact the form that browserified modules take, and thus this issue is one of the reasons why a browserified module can't itself be browserified.