Jump to content
Search Community

shovemedia

Members
  • Posts

    2
  • Joined

  • Last visited

shovemedia's Achievements

0

Reputation

  1. Absolutely. I wasn't suggesting that the official distribution be modified to create a hard dependency on requirejs, and I agree with your design approach. My understanding is that there *are* ways to make it work with both, but I'm not currently prepared to invest that kind of time. Certainly not until I feel like I've got a better handle on nodejs modules. By that point, it's possible that ECMAScript harmony module definitions will be "the" answer.
  2. The above approach is a bit overkill -- it'll include more code than you probably need (ie, all of TweenMax). My approach could do with more work; it'd be much better if the _gsDefine and _gsQueue were done away with entirely and replaced with require.js calls 1) wrap the js files you need with: define(function(require){ // ORIGINAL CODE HERE return TweenLite; // for example }); 2) For plugins, etc, you'll need to make sure that TweenLite is available before executing the plugin code. If you don't do this, you'll have a race condition and it'll work sometimes depending on which file gets loaded first: define(function(require){ require('lib/greensock/TweenLite'); // your path may vary // ORIGINAL CODE HERE return CSSPlugin; // for example }); 3) Your custom module now merely needs something like: var CSSPlugin = require('lib/greensock/plugins/CSSPlugin'); var TweenLite = require('lib/greensock/TweenLite');
×
×
  • Create New...