On windows and Visual Studio you can look at JSAnalyse: http://jsanalyse.codeplex.com/
I haven't tried it, but from the description, it parse the JavaScript files and creates a dependency tree of the different files based on the static references between them.
The project
JSAnalyse is a tool to analyze the dependencies between JavaScript
files and keep them under control. It helps to visualize and handle
static references between JavaScript files in order to ensure the
defined client-side architecture.
In the last couple years the amount of JavaScript lines in web
applications has been dramatically increased. A lot of new client-side
frameworks (like JQuery, Knockout, etc...) have aroused, but the tools
for developing JavaScript just got slightly better. For instance, the
Visual Studio 2010 has improved the IntelliSense. But for a
well-designed application, not only the server-side code is relevant
anymore. It is also very important to have a good architecture for the
client-side code and to keep it in a healthy and good state during the
whole application lifecycle. That is exactly when JSAnalyse comes into
play. It enables not just the possibility to analyze the existing
JavaScript dependencies but also to constrain them. The allowed
dependencies can be either configured via XML or by using the great
Visual Studio 2010 Architecture features. JSAnalyse provides an
extension for the Visual Studio Layer Diagram to validate and control
also dependencies between JavaScript files. This can be integrated
into the build and with the Gated Check-in feature it is not even
possible to check-in source code which does not fulfill the JavaScript
architectural rules.