Hey guys,
I'm getting suddenly issues with TweenMax in my project. It has worked fine for a while after following up this post. But recently I've got TweenMax variable not defined errors when running "build" / production npm script. So I've made the same thing with TweenMax as suggested for the ScrollToPlugin in the post:
const TweenMax = require("gsap/umd/TweenMax");
Worked indeed. But now I get:
ERROR in ./src/vendor/greensock-js-business-green/src/minified/plugins/ScrollToPlugin.min.js
Module not found: Error: Can't resolve 'TweenLite' in '/Path/to/project/src/vendor/greensock-js-business-green/src/minified/plugins'
When I include the ScrollToPlugin like this:
const ScrollToPlugin = require("gsap/umd/ScrollToPlugin");
... then I don't get any errors when compiling the app bundle. But the problem is TweenLite gets included on the top of TweenMax, which adds 30kb more to the already huge app.
I've tried then to in include the plugin from the greensock-js-business-green minified folder. But then I get this module not found error mentioned above.
So how can I include the ScrollToPlugin in a Webpack app without having to include TweenLite on the top of TweenMax?
Thank you in advance!
P.S.
MorphSVGPlugin seems not to cause these troubles when including from the "umd" folder :
const MorphSVGPlugin = require("~/vendor/greensock-js-business-green/src/bonus-files-for-npm-users/umd/MorphSVGPlugin.js");