Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
justingrant opened this issue Feb 4, 2020 · 2 comments
Labels
Milestone

Comments

@justingrant
Copy link

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

@swyxio
Copy link
Collaborator

swyxio commented Feb 4, 2020

i'll confess that i never even knew what declaration maps were, TIL

@agilgur5
Copy link
Collaborator

agilgur5 commented Feb 4, 2020

Yea after writing #488, where I added declarationMap: true to every fixture, I thought that it probably made sense to have as a default too, especially since source maps are already on by default. #479 was also my first hearing of declaration maps 😅

This does rely heavily on #488 going out to fix them, and that currently requires some breaking changes unless we come up with a good workaround 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants