I'm building a javascript library and would like to bake in various dependencies (e.g, jQuery, Google Closure, etc) without polluting the global namespace. This is particularly important because others may already be using different versions of these libraries.
As far as I can tell most of these libraries attach themselves directly to the window
object, so I cannot simply put them in an anonymous function.
Are there any general solutions to this problem?