I thought that I had to import DrawSVGPlugin inside of my .vue file to make it work, if I can omit to import it and it just plugs itself into TweenMax in a global way then that's good. Still, drawSVG is not working. This is my .vue file:
import TweenMax from 'TweenMax'
import TimelineMax from 'TimelineMax'
[..]
animateLogo () {
let svg = this.$el.querySelector('svg')
let letters = svg.querySelectorAll('.letters-group polygon')
this.$emit('logo-drawn')
TweenMax.staggerFromTo(letters, 3,
{
drawSVG: '0% 0%'
},
{
drawSVG: '0% 100%'
},
0.3
)
}
Right now DrawSVGPlugin is included in my main view and there's an alias for it inside webpack's configuration. _________________
Edit: Nevermind! Now it works! As you said, there's not need to import DrawSVGPlugin, I just need to have the alias and it has to be included in the global view. There's a problem with the snippet of code that I have provided you with, as it seems querySelectorAll NodeList isn't getting parsed correctly by TweenMax, that's why it doesn't animate the SVG. Sorry, my bad! One last thing, if it's not a problem: I also have some worries with EasePack easings, differently from the DrawSVG plugin I do have to include the classes inside my .vue file, as they have to be used (Power0, Power1 etc). I have no idea on how to import them and which alias should I use inside the external references of webpack. If I open DrawSVGPlugin.js, this is the last line of code:
}("DrawSVGPlugin"));
So I know I have to add this external:
"DrawSVGPlugin": "DrawSVGPlugin"
While EasePack.js doesn't have an explicit class it exports that I can use as an alias. I'll try some things and I'll let you know, as of now though I have no idea on how to make this work. Thanks for the replies by the way, you were very helpful on clearing my mind about this issue.