Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda