-
Notifications
You must be signed in to change notification settings - Fork 504
Can (should?) tsdx create declaration maps by default, like we do with sourcemaps? #490
Description
Current Behavior
tsdx enables sourcemaps by default, but not declaration maps.
tsdx/src/createRollupConfig.ts
Lines 155 to 159 in 424fc25
| compilerOptions: { | |
| sourceMap: true, | |
| declaration: true, | |
| jsx: 'react', | |
| }, |
Desired Behavior
Declaration maps are enabled by default, like we do for sourcemaps.
Suggested Solution
Adding declarationMap: true to the code excerpted above. If I'm understanding the code correctly in createRollupConfig, the user could opt out of declaration maps by setting declarationMap: false in tsconfig.json, which would override the defaults set in the code snippet above.
Who does this impact? Who is this for?
Library authors who want to make things easier for their library's users, especially devs using their library with VSCode or another IDE that leverages declaration maps.
Describe alternatives you've considered
Instead of code, this could be documentation to recommend to library authors that they add declarationMap: true to their tsconfig.json, but given that declaration maps are a best practice that we want every TS library to use, it seems aligned to the goals of tsdx to make declaration maps "just work" by default.