Jump to content

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

Create React App & scrollToPlugin

Recommended Posts

Hey guys,


I'm having trouble trying to import scrollToPlugin via webpack. This is the error I'm getting - 


 Error in ./~/gsap/src/uncompressed/plugins/ScrollToPlugin.js Module not found: 'TweenLite'



I've read in other posts that you modify the webpack.config file to resolve this however I'm using create-react-app and don't have access to the config file. Does anyone know a way around this?

Link to comment
Share on other sites

Hm, that's odd that you don't have access to the config file, but I can think of two other options:

  1. Just use a <script> tag for the GSAP-related stuff. You could load the files from the CDN and get the benefits of caching too. 
  2. -OR- delete the 4th line from the bottom of ScrollToPlugin where it says require("../TweenLite.js");

Do either of those work for you? 

Link to comment
Share on other sites

I used the CDN method, thanks for the advice.

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.