I aim to integrate an animation library (gsap) into a Gutenberg block to render both in the frontend and the editor. While I successfully imported gsap into view.js for frontend rendering, I encountered difficulties achieving the same effect in the editor. Despite attempting to import gsap into edit.js and wrapping the animation script within a DOMContentLoaded event listener, I have not achieved the desired outcome. I also tried importing gsap in both editor.js and index.js and then setting the “script” key in block.json to point to the animation script (gsap).
