Jump to content
Search Community

jonahvsweb

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by jonahvsweb

  1. Thanks to Greensock for helping me find my way on Twitter. I thought I'd share my solution for any other people out there that are searching for a configuration of Require + Backbone through external modules & shim's like I was: 

    require.config({
    
      paths: {
        'jquery': 'libs/jquery-2.1.1',
        'underscore': 'libs/underscore',
        'backbone': 'libs/backbone',
        'TweenLite': 'libs/greensock/TweenLite',
        'CSSPlugin': 'libs/greensock/plugins/CSSPlugin',
        'EasePack': 'libs/greensock/easing/EasePack'
      },
    
      shim: {
        'underscore': {
          exports: '_'
        },
        'backbone': {
          deps: [
            'underscore',
            'jquery'
          ],
          exports: 'Backbone'
        },
        'TweenLite': {
          exports: 'TweenLite'
        }
      }
    });
    
    require([
      'backbone',
      'app/app',
      'TweenLite',
      'CSSPlugin',
      'EasePack'
    ], function(Backbone, App, TweenLite) {
      'use strict';
    
      App.initialize();
    });
    
    • Like 2
×
×
  • Create New...