rexebin
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by rexebin
-
-
Thanks Carl!
I have not tried your suggestion, but I tried:
import {TweenLite, Linear} from "gsap";
When I only want to import TweenLite, I do not use TweenMax. However, it doesn't work, when I inspect my bundle, I see TweenMax being included even I do not use TweenMax anywhere.I think I will leave TweenMax as you suggested so. It is only 113k anyway, smaller than most of my images lol.
-
With Angular-cli, this works for me:
npm install gsap --save npm install @types/greensock
Add types in tsconfig.app.json under "compilerOptions":
"types": ["greensock"]
The last step is import GreenSock in main.ts:
import 'gsap';
After the above steps, I am able to start using "TweenMax" everywhere in the app.
However, there is one problem, I could not find a way to include TweenLite only in my final production bundle, for smaller production size. I hope someone could post their solution here.
GSAP Angular2 typescript import not working properly
in GSAP
Posted
It is Linear, I edited just in case.
I could live with 40k gripped, making the whole thing a lot easier to manage.