Jump to content
Search Community

rexebin

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by rexebin

  1. 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.

  2. 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.

×
×
  • Create New...