RequireJs makes dependency management on the client mostly better. Once it’s setup, it’s nice. Getting the patterns of your paths to work correctly can be difficult to setup, depending on the constraints of your system. Making the same paths work in a prod, test, and build environment can be even more adventuresome. In my case, there were a few extra hoops. My scenario might not fully match yours, but perhaps you can apply this solution to your own needs.
window (eg, if you use jQuery) or that manipulates the DOM (which could vary browser to browser).