I am trying out require.js and only include on js file at my main page. That main.js loads loads other scripts.
I am testing the performance of my site with yslow. It says that my page has 15 js files and I should try combining them into one. Isn’t this the the purpose of require.js? That I shouldn’t have to combine all my js into one large file?
Well, the idea of RequireJS is to build your scripts into modules (small parts). While doing that, you will notice that you are going to be dealing with many modules and thus many files.
To solve the “many files” problem, RequireJS has an optimizer.