Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RequireJS + jQuery
/* ========================================
* <Project> - <Description>
*
* Author:
* Last Edit:
* ========================================
* <License>
* ======================================== */
define(function(require, exports) {
"use strict";
/*jshint jquery:true, laxcomma:true, maxerr:50*/
// include other components
var component = require("path_to_component")
// declare private variables
, _i = {};
exports.init = function() {
// code here
};
});
// Require Configurations
require.config({
baseUrl : "js/libs"
, paths : {
"app" : "../app"
, "templates" : "../templates"
, "backbone" : "libs/backbone"
, "json2" : "libs/json2"
}
});
// Require Start
require(["app/main"], function(App) {
$(function() {
$("body").append("<h3>Hello Require</h3>");
App.init();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.