So I followed, Sebastian Nette's example for getting this to run on the server. I wasn't able to solve the dependencies missing issue; this doesn't seem to effect anything so far (tested TweenlineMax,TweenMax,Easing,etc.). The detailed steps for getting this to work are below; note, all these modifications are done on the same file, /node_modules/gsap/src/uncompressed/TweenMax.js
1 - add the following to the beginning of your file (* shimmed to work in browser as well):
var window = window || this
, navigator = window.navigator || { userAgent: "" }
, dummyElement = { style: {}, getElementsByTagName: function() { return [] } }
, document = document || { createElement: function() { return dummyElement } };
2 - Add the following "if" statement to the following loop, found on / near 6526.
for (p in _tweenLookup) {
a = _tweenLookup[p].tweens;
if(a && a.length) { // *** this is what I added; somehow a ends up undefined
i = a.length;
while (--i > -1) {
if (a[i]._gc) {
a.splice(i, 1);
}
}
if (a.length === 0) {
delete _tweenLookup[p]; // ** I'm thinking this is the culprit; should be spliced;
}
}
}
3 - At the end of the file, before the main closure, add the following:
module.exports = _gsScope;
4 - How to use:
var gsap = require('gsap');
var TimelineLite = gsap.TimelineLite;
var TweenMax = gsap.TweenMax;
var Easing = gsap.Easing;
Here is a link to my github repo where I put my working TweenMax.js script: HERE
I am still getting these errors:
GSAP encountered missing dependency: com.greensock.size
GSAP encountered missing dependency: com.greensock.clean
GSAP encountered missing dependency: com.greensock.byIndex
... Anyone know where these reside || how to fix it? Also, why don't these fixed already exist?