janpaepke / ScrollMagic

The javascript library for magical scroll interactions.
http://ScrollMagic.io
Other
14.88k stars 2.17k forks source link

GSAP & AMD: requiring both TweenMax and TimelineMax #427

Open theprojectsomething opened 8 years ago

theprojectsomething commented 8 years ago

I believe TimelineMax is included in the TweenMax library, yet ScrollMagic requires each file separately in it's AMD setup in animation.gsap.js (adding 6kb to the build).

see https://github.com/janpaepke/ScrollMagic/wiki/Getting-Started-:-Using-AMD

homerjam commented 8 years ago

I believe TimelineMax is included in the TweenMax library

This is correct

VarinderS commented 8 years ago

Yes, even though it needs each file separately, it isn't required as TweenMax loads TimelineMax anyway.

So, I went ahead and removed TimelineMax dependency from define(['ScrollMagic', 'TweenMax', 'TimelineMax'], factory); here changing it to define(['ScrollMagic', 'TweenMax'], factory);

Builds fine for now

hellorich commented 8 years ago

I hit this issue as well. Is this due to a change in Greensock that the plugin hasn't kept up with, or something else I'm misunderstanding?

massic80 commented 6 years ago

I figure out they are left separately because one could just use TimelineMax (with TweenLite?) and not TweenMax.