I did somewhat an accident discovery that I was able to load my data-main js file in a file that doesn't load requireJS
<script type="text/javascript" src="requirejs.config.js" data-main="theme.js"></script>
<script type="text/javascript" src="requirejs.js"></script>
and it perfectly loads my theme.js file
is this an intentional feature of requirejs? or a bug?
I hope this isn't a bug.
the contents of my requirejs.config.js are below
var require = {
baseUrl: '/js/',
paths: {
'jquery': "lib/jquery/jquery",
'bootstrap': "lib/bootstrap/js/bootstrap"
},
shim: {
'bootstrap': ['jquery']
},
map: {
'*': {
'jquery': 'jQueryNoConflict'
},
'jQueryNoConflict': {
'jquery': 'jquery'
}
}
}
I check every samples here and seems they are not doing what I accidentally discovered.
data-main. I can only assume that you're getting lucky in that it's loading the scripts in the correct order by chance, it's certainly not guaranteed with that setup.