Skip to content

Instantly share code, notes, and snippets.

@camoconnell
Last active December 18, 2015 08:39
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 camoconnell/5755383 to your computer and use it in GitHub Desktop.
Save camoconnell/5755383 to your computer and use it in GitHub Desktop.
Require js - Uncaught TypeError
window.App = {};
// Place third party dependencies in the lib folder
//
// Configure loading modules from the lib directory,
// except 'app' ones,
require.config({
urlArgs: "bust=" + (new Date()).getTime(),
baseUrl: WP.THEME_URL+"/js",
// The shim config allows us to configure dependencies for
// scripts that do not call define() to register a module
shim: {
lodash: {
exports: '_'
},
backbone: {
deps: [
'lodash',
'jquery'
],
exports: 'Backbone'
}
},
paths: {
app : "app"
, jquery : "lib/jquery-2.0.2.min"
, lodash : "lib/lodash.min"
, backbone: "lib/backbone-min"
, raphael : "lib/raphael-min"
, plugins : "lib/plugins"
, utils : "app/utilities/utils"
, resize : "app/utilities/resize"
, scroll : "app/utilities/scroll"
, models : "app/models"
, views : "app/views"
}
});
// Load the main app module to start the app
require(["app/main"],function(){});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment