Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Visual Studio Code - how to Go To Definition / open file in JavaScript import statements?

I have a html file with JavaScript module in it, like so:

<script type="module">

    import * as LOADER from './path/loader.js'

    import { add } from '/path/ui.js'

  </script>

I run a server at localhost, so I have a local folder set as a root (under Win10) and the file works perfectly in the browser.

When I open this file in VS Code, it doesn't understand paths mentioned in import statements, relative or absolute, I can't use Go To Definition or Peek or open imported .js files.

Is it possible to make VS Code work with import statements?

I created jsconfig.json file in the same folder as the html file:

{
  "compilerOptions": {
    "module": "commonjs",
    "baseUrl": ".",
    "paths": {
      "/*": ["./*"]
    }
  },
  "include": ["/path/*"]
}

but it doesn't make any difference.

EDIT:

the paths are not underlined like links in href attributes for example. I know it should work but it doesn't.

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!