I believe that requirejs and module loaders generally have a different approach to reducing global clutter than the namespace. If necessary, you do not need to bind things to the global namespace, just use the call to the require method within the closure to get local references.
So you are exchanging one bit of global clutter (i.e. window.require) for all the other things you will need to attach.
In an implementation with a name extension, you should use something like
var foo = window.my_scope.foo.bar
With module loaders you should use a call. In the case of the CommonJS module loader, you would do something like this
var foo = require("my_scope/foo/bar")
RequireJs adds a bit more complexity because it is an AMD module loader, but this other whole conversation is in itself!
source share