Jump to content
GreenSock

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

Premium plugins - VueJS + WebPack

Recommended Posts

Hi,
I need a help with import MorphSVGplugin into my VueJS app. I have tried to find some solution in forum, but I didn't find anything.

I found for example this https://greensock.com/forums/topic/17245-how-to-use-gsap-with-vuewebpack-vue-cli-webpack-template/ . But also didn't help me. 

 

Firstly I moved MorphSVGPlugin.js to node_modules like in the photo. Then I tried to import plugin to app but without success.

 

And error was: 

Error message was: Failed to compile.

./node_modules/gsap/src/uncompressed/plugins/MorphSVGPlugin.js
Module not found: Error: Can't resolve 'TweenLite' in 'C:\Users\sducak\Desktop\none-yet\client\node_modules\gsap\src\uncompressed\plugins'

 

Thank for help.

 

Simon

Screenshot_1.png

Screenshot_2.png

Screenshot_3.png

Link to comment
Share on other sites

It looks like you're using the wrong file. From what I can tell, you're looking for an ES module file, but you're using the ES5 file that's intended for use directly in the browser. 

 

In your download zip, look in the "bonus-files-for-npm-users" folder. Grab the MorphSVGPlugin.js file from there (which is an ES module), and drop it into your "gsap" folder in the "node_modules" directory (NOT in src/uncompressed). Does that resolve things for you? 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Just require it anywhere, it will be registered to window.

Link to comment
Share on other sites

Now it works. 

 

Thank for help. 

 

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