Skip to content

Instantly share code, notes, and snippets.

@jacobk
Created May 8, 2012 19:06
Show Gist options
  • Save jacobk/2638548 to your computer and use it in GitHub Desktop.
Save jacobk/2638548 to your computer and use it in GitHub Desktop.
├ app/config.js
├ app/em.js
│ ├─ jquery
│ ├─ use!underscore
│ ├─ use!backbone
│ ├─ use!handlebars
│ └─ use!plugins/backbone.layoutmanager
├ app/main.js
│ ├─ em
│ ├─ jquery
│ ├─ use!backbone
│ ├─ modules/example
│ ├─ modules/user
│ ├─ modules/login
│ └─ use!plugins/bootstrap
├ app/modules/example.js
│ ├─ em
│ └─ use!backbone
├ app/modules/login.js
│ ├─ em
│ ├─ use!underscore
│ └─ use!backbone
├ app/modules/user.js
│ ├─ em
│ ├─ use!underscore
│ └─ use!backbone
// Set the require.js configuration for your application.
require.config({
// Initialize the application with the main application file
deps: ["main"],
paths: {
// JavaScript folders
libs: "../assets/js/libs",
plugins: "../assets/js/plugins",
// Libraries
jquery: "../assets/js/libs/jquery",
underscore: "../assets/js/libs/underscore",
backbone: "../assets/js/libs/backbone",
handlebars: "../assets/js/libs/handlebars-1.0.0.beta.6",
// Shim Plugin
use: "../assets/js/plugins/use"
},
use: {
backbone: {
deps: ["use!underscore", "jquery"],
attach: "Backbone"
},
underscore: {
attach: "_"
},
handlebars: {
attach: "Handlebars"
},
"plugins/bootstrap": {
deps: ["use!jquery"]
},
"plugins/backbone.layoutmanager": {
deps: ["use!backbone"]
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment