The point is to build your application using AMD, using individual assets in development, and then run the optimizer - which concats and adds a loader - for production.
Alternatively, you can even go a step simpler and always use concatenated files, along with a minimal loader like Almond.js[1]. If you do this, you'll probably want to use something that adds source maps for your concatenated file (for easier debugging), but that's easy - you can use grunt-concat-sourcemap[2] or a similar plugin for whatever build system you like.
Minifying+concatenating is the most appealing solution for desktop browsers which employ a rather large cache on static files, considering that a web server is also fine-tuned to take advantage of caching (e.g. http://httpd.apache.org/docs/2.2/mod/mod_expires.html). I am not sure though that this is the best approach for mobile devices; having to serve a relatively large JS/CSS file with (possible) network interruptions may increase page load time.
Totally misses the point of Require JS - modularisation of code, dependancy management, namespacing, etc - beside the fact that it comes with an awesome optimiser that does mashes everything into one script anyway...
Even without require.js' r.js optimization tool, having multiple source files like this is not necessarily a bad thing. Smaller files are more likely for browsers to cache them. If you concatenate all source files into one 5MB[1] file, it is unlikely the browser is going to cache that. This is more of a trade off than absolute best thing.
6 comments
[ 4.8 ms ] story [ 28.7 ms ] threadRequire.js has an optimizer that does exactly what the author suggests: http://requirejs.org/docs/optimization.html
The point is to build your application using AMD, using individual assets in development, and then run the optimizer - which concats and adds a loader - for production.
Alternatively, you can even go a step simpler and always use concatenated files, along with a minimal loader like Almond.js[1]. If you do this, you'll probably want to use something that adds source maps for your concatenated file (for easier debugging), but that's easy - you can use grunt-concat-sourcemap[2] or a similar plugin for whatever build system you like.
[1]: https://github.com/jrburke/almond
[2]: https://github.com/kozy4324/grunt-concat-sourcemap
[1]: http://serverfault.com/questions/338722/what-is-the-maximum-...