This concatenation not the ideal way to make your code modular. A better solution is to simply rely on a build tool such as browserify or r.js to compile your files for you. If you use browserify, you get the benefit of having the same module require system on the server and in the browser. Browserify can also output an AMD bundle that people can use with bower if they prefer AMD.