Jump to content
Search Community

Getting TweenLite to work with RequireJS + BackboneJS

jonahvsweb test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

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
Link to comment
Share on other sites

  • 9 months later...

Thanks Jonah! How exactly did you implement it into your app - meaning what file did you put it in, etc? I'm using 'yo' to scaffold my backbone.js app so just wondering the best place to add this config file (p.s. I'm a newb to backbone.js too)

 

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...