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

290
Views
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
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!