I have been using gsap, and i have came across a issue. If i call this script in the html page and then write my animations in a <script> tag, my animations work fine, but as soon as i switch to my js file to clean up the html page, no animations work. I did npm init, and npm install gsap --save.I have tried importing multiple ways, with different animation syntax. The first part is what i used before which worked, and the second part is with the external js file and the html <script> tag.
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.4.0/gsap.min.js"></script>
<script
type="text/javascript"
src="PATH TO MY JS FILE(I DID WRITE THE ACTUAL PATH HERE, TO LET YOU KNOW"
></script>
import { gsap } from "gsap";
gsap.to(".head", { y: 300, ease: "bounce" });