I want to include jQueryUI in my backbone.js app using RequireJS. The main.js file included in my index.html is as follows:
require.config({
paths: {
You can include all files that only patch some other object (like jQuery UI) in your main file as follows (you need to make sure jQuery is loaded before jQuery UI):
require(['jquery', 'app', 'jqueryui'], function ($, App) { App.start(); });
Another approach is to include jQuery UI in every module as you already mentioned.
I personally prefer first approach even though it's hiding dependencies.