Jump to content
Search Community

TextPlugin not working with import

mkurdziel test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi!

 

I have a problem with TextPlugin.

I use Webpack with Gulp, and im importing it this way: 

import { TweenMax, TimelineMax, TextPlugin } from 'gsap';

TweenMax and TimeLineMax are working fine but TextPlugin is not working at all. Just nothing happen.

 

Here is my code:

var tlHome = new TimelineMax({});

tlHome.to( ".heading--intro__1", 2, {text: "Design your brand's story."})
      .to( ".heading--intro__2", 2, {text: "Scale it up globally."})
      .to( ".heading--intro__3", 2, {text: "Predict the future."})

 

Any ideas why is TextPlugin not working?

Link to comment
Share on other sites

Glad to hear it's working, but I'm a tad confused because "gsap" actually points to TweenMax (long story), so the only things exported from there are tools that are inside TweenMax (like CSSPlugin, TweenLite, TweenMax, TimelineLite, TimelineMax, all the eases, etc.) but TextPlugin is NOT included in TweenMax. So you can either import things from "gsap/all" or you can import TextPlugin directly (and separately) like:

 

import TextPlugin from "gsap/TextPlugin";

 

  • Like 2
Link to comment
Share on other sites

I also thought that "gsap" points to gsap folder...

I made it this way:

 

import { TweenMax, TimelineMax, TextPlugin } from 'gsap/all';

// Webpack treeshaking fix
const plugins = [ TextPlugin ];

 

Looks like a Webpack uses unnecessary feature in this case.

Maybe there is some solution.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...