We're using requirejs for the first time, and I'm having trouble structuring my dependencies.
I've defined my main app.js file as the data-main attribute in my index.html:
<script data-main="src/app" src="/js/lib/require/require.js"></script>
But, I have a file which defines all my require path/shim configurations, and I want that to run before the app.js file. I need it to run so that I can reference configured paths as dependencies in my app.js.
I don't think the right way is to put my config.js as the data-main. I tried setting the config.js as a dependency like this:
<script type="text/javascript">
var require = {
baseUrl: "/",
deps: ["src/config"]
}
</script>
<!-- data-main is the main js file of the app -->
<script data-main="src/app" src="/js/lib/require/require.js"></script>
but that didn't help.
Any suggestions?