Skip to content

Instantly share code, notes, and snippets.

@JPGygax68
Last active September 18, 2017 19:33
Show Gist options
  • Save JPGygax68/6065635 to your computer and use it in GitHub Desktop.
Save JPGygax68/6065635 to your computer and use it in GitHub Desktop.
Copy-paste example of a #require_js configuration, including loading require.js from the "scripts" subdirectory.Indented two levels (2 spaces per level) for correct insertion in the document header.
<script type="text/javascript" src="scripts/require.js" data-main="app/main"></script>
<script>
requirejs.config({
paths: {
'underscore': 'lib/underscore',
'jquery' : 'lib/jquery-2.0.3',
'backbone' : 'lib/backbone',
'relational': 'lib/backbone-relational',
'css' : 'lib/css.min'
},
shim: {
underscore: {
exports: '_'
},
backbone: {
deps: ["underscore", "jquery"],
exports: "Backbone"
},
relational: {
deps: ["backbone"]
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment