Loading package/script for best lighthouse performance?
I am trying to optimize our site for lighthouse but am running into some trouble. On desktop it scores very highly, sometimes 99 on speed, but on mobile its in the 50s. I noticed this is partly because of the js it loads initially for nuxt. But also in those scripts I can see a package I have installed (GSAP). I don't want this loaded initially as it isn't as important. I'm using it in a plugin, is there any way to defer this plugin to load later? If I use the app head in my nuxt.config.ts to add the GSAP script to the bottom of my body, will my animations work in components? Any help or guidance is appreciated.
1 Reply
plugins can't be deferred to later but you could lazy-load the script otherwise 🙂