Jump to content
Search Community

Importing DrawSVGPlugin with preact-cli causes webpack error 'Can't resolve '../TweenLite.min.js''

heytopher 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

Hey everyone,

 

Judging by the forum posts, i'm pretty certain this issue has been posted a thousand times before but after a few hours I thought I'd try here.

 

I've done the following:

 

- created a new project created with preact-cli,

- copied club member minified plugin DrawSVGPlugin, Draggable and ThrowPropsPlugin to a /src/vendor directory

- imported DrawSVGPlugin in my app.js

 

I recieve the following error:

 

✖ ERROR ./src/vendor/DrawSVGPlugin.min.js

Module not found: Error: Can't resolve '../TweenLite.min.js' in ....

 

Attempted to add the aliases to the preact.config.js file by adding config.resolve.alias.TweenLite = [path to node_modules gsap] but it didn't work.

 

I haven't posted any code but I can setup a dummy project if need be.

 

Any help is greatly appreciated.

 

Cheers, Topher.

Link to comment
Share on other sites

Howdy Topher. Did you try using the bonus plugins from the "bonus-files-for-npm-users" that are in the zip? Those have their dependencies set up so that you can put them anywhere. The problem that it sounds like you're running into is that you're using the ones in /src/minified/ which are using relative references in their dependencies which is fine if you keep all those files together, but it sounds like you pulled the bonus stuff out and plopped it elsewhere. Don't worry, you're not the first person to do that which is why we provided the "bonus-files-for-npm-users" stuff. 

 

Does that help at all? 

 

Thanks for being a Club member by the way. 

  • Like 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.
×
×
  • Create New...