-
Notifications
You must be signed in to change notification settings - Fork 61
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
ignore require() calls inside already browserified bundles #79
base: master
Are you sure you want to change the base?
Conversation
5592233
to
796bdae
Compare
Will do this for browserify 17 if there are no complaints by then |
What happens if someone has unbrowserified code that has a function argument named “require”? |
calls to that argument would not be collected as dependencies of the file. I considered that but thought that it would be very rare. But the check could be tightened further to check for the full |
I think making it as strict as possible is a good idea, just in case. People may have even copy pasted browserify preambles into their code, and it’d be good to maximize what works. |
If a function expression declares a `require` parameter, its body is not analyzed for `require()` calls. This is mostly helpful for bundles that were already browserified, `detective` will ignore the calls to browser-pack's require runtime.
796bdae
to
c9bfb24
Compare
Did this ever land? Asking for browserify/browserify#1817 |
If a function expression declares a
require
parameter, its body is notanalyzed for
require()
calls. This is mostly helpful for bundles thatwere already browserified,
detective
will ignore the calls tobrowser-pack's require runtime.
Doing full scope analysis using
scope-analyzer
would slow things down by at least about 30%; this patch however has no measurable performance hit and addresses the most common case of howrequire
might end up redefined.Fixes browserify/browserify#1773 (comment)