I am upgrading a project from Dojo 1.6.1 using AMD and RequireJS to Dojo 1.7.1 with its new AMD loader. I have to deal with old JavaScript files, not written as AMD modules, and have to load them in the correct order.
Before I used the RequireJS order plugin, but it does not seem to work with Dojo AMD Loader. I can not find anything about it in the loader documentation or the Dojo Build System documentation.
Any thoughts about this? If there is no order plugin, how should I handle plain JavaScript files together with Dojo 1.7? Do I need to handle them separately, or are there functionality for this in the loader or build system?
I'm just learning about this myself, but the documentation I found refers to Generic Script Injection
Load your generic scripts as described in the docs, while specifying {async: 0} as a configuration option for require(). This, to my understanding, does load the scripts in the order that you specify in the the second parameter (the array containing the script filenames/paths)
My example:
My local tests show if I change config to {async: 1} the scripts load in a different order to what I specified. So far I haven't tracked this down in the dojo loader code, but it seems to make sense, and work, and isn't a hack.