Jump to content
Search Community

require("gsap/gsap-core")

gotofig2 test
Moderator Tag

Recommended Posts

Hi I wonder if anyone can shed light on this for me.

 

I (intermitantly) find the line:

 

const { default: gsap } = require("gsap/gsap-core")


added to line 1 of my main.js code in vscode. 

 

Does this mean that it does not have access to the GSAP library?

 

I am linking to the cdn in my html as follows:

 

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/ScrollTrigger.min.js"></script>
<script src="main.js"></script>
</body>
</html>

 

Link to comment
Share on other sites

5 hours ago, gotofig2 said:

I (intermitantly) find the line:

const { default: gsap } = require("gsap/gsap-core")
added to line 1 of my main.js code in vscode. 

It sounds like someone is sneaking into your office and adding it ;) 

 

Kidding. But if you're using regular HTML files and are loading GSAP like that (i.e. not as a module) that doesn't make sense why VS Code would be adding it. It still works if you remove it, right?

 

Maybe you could ask in a VS Code forum somewhere.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...