I am wondering if there is a way to pass parameters to the requireJS with the data-main parameter.

<script data-main="Main"  src="lib/require/require.js"></script>

I can introduce globals:

<script>
    var mainId = "Main";
    var mainTarget = "body";
</script>
<script data-main="Main"  src="lib/require/require.js"></script>

But I was wondering if there was a cleaner way to do it. Thanks!

EDIT:

Simon, this is a great plan I think for the mainTarget value.

require([
    'plugins/load!./'+mainId+'.htm',
    'plugins/load!./'+mainId+'.css'
],function(html,css){
    var Main = function(){
        this.__proto__ = mainTarget;
    }
    new Main();
}

How do I apply this to mainId?

Edit
Report