Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if require is aliased, detective incorrectly returns uses of it as dependencies #22

Open
fresheneesz opened this issue Aug 12, 2013 · 3 comments

Comments

@fresheneesz
Copy link

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.

@jmm
Copy link

jmm commented Nov 30, 2015

@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).

@jfirebaugh
Copy link

jfirebaugh commented Mar 22, 2017

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.

@goto-bus-stop
Copy link
Member

#79 implements a fast special case to ignore require calls inside browserified bundles, which I think is the most common situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants