Skip to content

Instantly share code, notes, and snippets.

@w1shen
Last active December 14, 2015 18:09
Show Gist options
  • Save w1shen/5127448 to your computer and use it in GitHub Desktop.
Save w1shen/5127448 to your computer and use it in GitHub Desktop.
Using non-AMD compatible javascript module with the shim config of require.js.
requirejs.config({
paths: {
"underscore": "http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min",
"jquery": "http://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min",
"backbone": "http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.10/backbone-min"
},
shim: {
// Using non-AMD compatible javascript module with the shim config of require.js.
"underscore": {
exports: "_"
},
"backbone": {
deps: ["underscore", "jquery"],
exports: "Backbone"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment