Skip to content

Instantly share code, notes, and snippets.

@alejandroiglesias
Last active December 16, 2015 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alejandroiglesias/5514179 to your computer and use it in GitHub Desktop.
Save alejandroiglesias/5514179 to your computer and use it in GitHub Desktop.
First file is my RequireJS config. Second, is the main require() call.
{
name: 'components/almond/almond',
include: 'lib/emform',
out: 'dist/emform.js',
optimize: 'uglify2',
useStrict: true,
shim: {
'handlebars': {
exports: 'Handlebars'
}
},
wrap: {
start: '(function (window, document, undefined) {',
end: '}(window, document));'
},
paths: {
'bean': 'components/bean/bean',
'handlebars': 'components/handlebars.js/dist/handlebars.runtime',
'reqwest': 'components/reqwest/reqwest'
}
}
require([
'lib/config',
'handlebars',
'bean',
'reqwest'
], function (config, handlebars, bean, reqwest) {
'use strict';
console.log(handlebars); // undefined
console.log(config, bean, reqwest); // OK
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment