I've seen many variations to loading modules which do not support AMD yet, and I would like to know what is the best practice to do so.
Eventually, I would like to write modules like this:
module.js:
define(["jQuery", "Underscore", "Backbone"], function($, _, Backbone) {
... module code here
}
But there are a lot of problems with loading those dependencies using AMD since they are not all AMD compliant.
I've created a todo-list boilerplate web app which loads all modules as AMD modules (without loaders).
Check it out:
https://github.com/ronreiter/webapp-boilerplate
Thomas Davis has a better example (imo) for loading jquery/underscore/backbone in his non-updated example. Start by looking at the loader here
It uses the RequireJS order plugin found here to load the modules synchronously.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With