r.js requireJS. Must I modify my HTML?

36 views Asked by At

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 ?

1

There are 1 answers

0
Dimitris Zorbas On BEST ANSWER

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.