Skip to content

Instantly share code, notes, and snippets.

View jrburke's full-sized avatar

James Burke jrburke

View GitHub Profile
@jrburke
jrburke / config.js
Created November 8, 2012 05:55
RequireJS jQuery adapter approach
//Set up the adapter config, so that any module asking
//for jquery gets an adapter module that has modified
//jquery before other modules can use it.
//Needs RequireJS 2.0+ to work correctly
//More info on map config:
//http://requirejs.org/docs/api.html#config-map
requirejs.config({
map: {
'*': {
'jquery': 'jquery.adapter'
@jrburke
jrburke / amdconfig.md
Created January 18, 2012 00:52
Rough draft of common config understood by loaders

Attempt to list some possible standard AMD loader configuration values.

An AMD loader is not required to implement all of these configuration values, but if it does provide a capability that is satisfied by these configuration values, it should use these configuration values and structures.

baseUrl

String: Indicates the root used for ID-to-path resolutions. Relative paths are relative to the current working directory. In web browsers, the current working directory is the directory containing the web page running the script.

@jrburke
jrburke / build.js
Created December 22, 2011 05:58
Doing multiple almond builds with a nodejs script, example
//Download jquery.js and place it in the build, do not use require-jquery.js
//in the build, since each of the build layers just needs almond and not the
//full require.js file.
//This file is run in nodejs to do the build: node build.js
//Load the requirejs optimizer
var requirejs = require('./r.js');
//Set up basic config, include config that is
//common to all the requirejs.optimize() calls.