Skip to content

Can (should?) tsdx create declaration maps by default, like we do with sourcemaps? #490

@justingrant

Description

@justingrant

Current Behavior

tsdx enables sourcemaps by default, but not declaration maps.

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.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions