title: How to get external library intellisense to work in vscode for javascript?
body: <p>I'm trying to get intellisense to work for external libraries (namely gsap). </p>
  
  <p>no matter what I try I can't get it to work properly.</p>
  
  <pre><code>/// &lt;reference path="Tweenmax.min.js" /&gt;
  //or
  /// &lt;reference type="gsap" /&gt;
  </code></pre>
  
  <p>adding triple slash reference path doesn't change anything.
  the only way I could get it to work was importing a ts declaration like this:</p>
  
  <pre><code>import { TimelineMax } from "gsap";
  </code></pre>
  
  <p>I searched forums and everywhere, some suggested using "tsd" but it was deprecated and didn't work, so I used the newer npm @types/gsap hoping it would work, but it only works if I import it.</p>
  
  <p>This works fine in vscode as it properly shows a good autocomplete with a perfect understanding of the interface. but I can't use this code as in when it's loaded in the browser, chrome doesn't like that line and throws an error like this:</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token {
  </code></pre>
  
  <p>I've been working on this for 2 hours, and I can't get anywhere close to a good solution. I remember sometimes ago vscode used to show autocomplete for open documents, but even that doesn't work, even if I keep TweenMax.min.js open, it still does nothing.</p>
  
  <p>I don't know what I'm doing wrong. </p>
  
  <p>to be clear I don't want to be using typescript file and then compiling it, I don't even want to import anything, I just want to get something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ca9Lt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ca9Lt.png" alt="enter image description here"></a></p>
  
  <p>and the only way I could get it to work so far is to keep the import declaration while coding and then commenting it for testing. this is stupid, is there a good way?</p>