I'm having a problem getting GSAP3 PlugIns to work in a Nuxt(2.10.2) project.
To make sure it wasn't something else I had installed within my existing project, I created a new base nuxt project and I installed GSAP with the .tgz file from the "npm-install-this" directory.
If I add the the base gsap as in
import { gsap } from "gsap";
it works fine, I ran a small tween to test.
However, when I try to introduce a plugin, as suggested, and refresh
Ok, without doing transpile: ["gsap"], I got it to work like this. Using require, it imports an object.
let gsap, Back, MorphSVGPlugin;
if (process.client) {
const gsapModule = require("gsap/dist/gsap");
gsap = gsapModule.default;
Back = gsapModule.Back;
MorphSVGPlugin = require("gsap/dist/MorphSVGPlugin.js").default;
gsap.registerPlugin(MorphSVGPlugin);
}
Using transpile: ["gsap"], this worked for me.
import { gsap, Back } from "gsap";
import { MorphSVGPlugi