Skip to content

Instantly share code, notes, and snippets.

@mpriour
Created July 31, 2013 21:24
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 mpriour/6126325 to your computer and use it in GitHub Desktop.
Save mpriour/6126325 to your computer and use it in GitHub Desktop.
possible requirejs config to get dojo & esri to play nice with require.js (in browser ONLY)
/* global require */
require.config({
baseUrl: 'bower_components',
shim: {
underscore: {
exports: '_'
},
backbone: {
deps: [
'underscore',
'jquery'
],
exports: 'Backbone'
},
bootstrap: {
deps: ['jquery'],
exports: 'jquery'
}
},
paths: {
jquery: 'jquery/jquery',
underscore: 'underscore-amd/underscore',
backbone: 'backbone-amd/backbone',
bootstrap: '../scripts/vendor/bootstrap',
rjstext: 'text/text',
i18n: 'requirejs-i18n/i18n',
/* THESE are implied given the baseUrl
dojo: 'dojo',
dijit: 'dijit',
dojox: 'dojox',
dgrid: 'dgrid',
xstyle: 'xstyle',
'put-selector': 'put-selector',
*/
//esri: '//js.arcgis.com/3.6amd/js/esri',
esri: '/Users/matt/projects/ArcGIS/RIA/JavaScript/ArcGIS2/devOutput/jsapi/src/js/esri',
app: '../scripts/myApp'
},
map: {
'*': {
'text': 'rjstext'
}
}
});
require(['app/Controller', 'backbone', 'bootstrap'], function(Controller, Backbone) {
'use strict';
Controller.startup();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment