Closed crazyx13th closed 6 years ago
if i using this inside my webpack config, size is ok, but than he don't find TweenLite at frontend > uncaught TypeError: Cannot read property 'set' of undefined
"gsap" points to the TweenMax file (which includes TweenLite, all the eases, and a bunch more) - that's why you got a larger file. You can import from "gsap/TweenLite" and "gsap/EasePack" to keep the file smaller, but I'm not quite sure what you're trying to animate so you may need CSSPlugin too.
You could simply load GSAP from a CDN instead of bundling them with your project. Most bundlers like Webpack allow that sort of thing, and it lets you leverage the power of CDNs for super fast load speeds (and leveraging of cache).
I'm not entirely sure what's causing your "set" error (very difficult to diagnose blind).
Lastly, you might want to use Power3 or Power4 instead of Expo ease because those are baked into the core TweenLite file (less file size).
Lastly, you might want to use Power3 or Power4 instead of Expo ease because those are baked into the core TweenLite file (less file size).
good to know!
I only want to call TweenLite.set(...)
inside the chrome console it seems to be available
seems to be a namespace issue :-/ thx!
ok, this solved my problem
AND (!) :
I'm not quite sure what you're trying to animate so you may need CSSPlugin too.
I simply thinking I don't need it... but I was wrong. And later I forgot about it, that i comment it out
THX!
hope tree-shaking feature will be available soon :-) https://github.com/greensock/GreenSock-JS/issues/215
Greetings crazyx13th
hey there!
I'm using
import {TweenLite, Expo} from 'gsap';
But at the end I got with Webpack > CommonsChunkPlugin a "vendor-output" with 114kb!Is this a normal behavior? Because if I'm using the cdn way I have TweenLite.min.js (28kb) + EasePack.min.js (6kb)
Thanks!
Greetings crazyx13th