Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

How to import ScrollTrigger using skypack.dev ?

Go to solution Solved by GreenSock,

Recommended Posts

I followed the solution by OSUblake on how to use imports as a CDN within <script type="module"> to import GSAP.

I also added the required registration of gsap.registerPlugin(ScrollTrigger); but console error states that ScrollTrigger is undefined. I did not find any reference on skypack.dev on how to separately import ScrollTrigger plugin.

Does the cdn import from skypack.dev for GSAP also include ScrollTrigger or does it need to be imported separately ?


Link to comment
Share on other sites

  • Solution

ScrollTrigger is a plugin - it's not part of the core GSAP file. Have you tried this?

import { ScrollTrigger } from "https://cdn.skypack.dev/gsap/ScrollTrigger";

Side note: please don't double-post your questions ; once is enough. :)

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