Skip to content

Instantly share code, notes, and snippets.

@taxilian
Last active December 12, 2015 15:29
Show Gist options
  • Select an option

  • Save taxilian/4790603 to your computer and use it in GitHub Desktop.

Select an option

Save taxilian/4790603 to your computer and use it in GitHub Desktop.
require.js shim config for loading twitter bootstrap
/*global requirejs*/
requirejs.config({
shim: {
"bootstrap/js/bootstrap-affix": ["jquery"],
"bootstrap/js/bootstrap-transition": ["bootstrap/js/bootstrap-affix"],
"bootstrap/js/bootstrap-alert": ["bootstrap/js/bootstrap-transition"],
"bootstrap/js/bootstrap-button": ["bootstrap/js/bootstrap-alert"],
"bootstrap/js/bootstrap-collapse": ["bootstrap/js/bootstrap-button"],
"bootstrap/js/bootstrap-dropdown": ["bootstrap/js/bootstrap-collapse"],
"bootstrap/js/bootstrap-modal": ["bootstrap/js/bootstrap-dropdown"],
"bootstrap/js/bootstrap-tooltip": ["bootstrap/js/bootstrap-modal"],
"bootstrap/js/bootstrap-popover": ["bootstrap/js/bootstrap-tooltip"],
"bootstrap/js/bootstrap-scrollspy": ["bootstrap/js/bootstrap-popover"],
"bootstrap/js/bootstrap-tab": ["bootstrap/js/bootstrap-scrollspy"],
"bootstrap/js/bootstrap-typeahead": ["bootstrap/js/bootstrap-tab"]
}
});
define(["jquery",
"./js/bootstrap-affix",
"./js/bootstrap-transition",
"./js/bootstrap-alert",
"./js/bootstrap-button",
"./js/bootstrap-collapse",
"./js/bootstrap-dropdown",
"./js/bootstrap-modal",
"./js/bootstrap-tooltip",
"./js/bootstrap-popover",
"./js/bootstrap-scrollspy",
"./js/bootstrap-tab",
"./js/bootstrap-typeahead"
], function($) {
// Nothing needed, this is just to include the others
});
@taxilian
Copy link
Copy Markdown
Author

Worth noting that the shim paths are the absolute paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment