Using requireJS to load 4 JS files, my HTML markup looks like this :
<script data-main="js/app" src="js/vendor/require.js"></script>
I run r.js to compile files to main-built.js.
How can I now ask requireJS to load main-built.js instead of all the js files ?
You may use server-side code to determine the environment and load the appropriate optimized script or use a tool like grunt or yeoman. Have a look at this similar question.