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

291
Vistas
How to set sourse map for d.ts files?

I've created a TypeScript library. It has an src directory with .ts files and dist/esm directory, where all .ts file are converted into .js, .js.map and .d.ts files. The library is working, it has typings but there are some problems with the development process.

In the IDE (I use Webstorm) when I click to the component from my library I'd like to open a source file from src directory. But instead I open a typings declaration file (.d.ts).

I've found out that when I add to the .d.ts file a link to a source map like so:

/// <reference types="react" />
import './styles/Button.scss';
export declare const Button: () => JSX.Element;
// The line below has been added
//# sourceMappingURL=Button.js.map

the IDE starts automatically open needed file from src directory.

And I'd like to know is it a correct way to open files from source directory of a library?

If it is, how can I automatically add these lines in every .d.ts files using Rollup?

If it's not, could you please describe how to do it in the correct way?

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