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

Is tsconfig.json declarationMap not honored? #488

Closed
scottmas opened this issue Dec 9, 2021 · 6 comments
Closed

Is tsconfig.json declarationMap not honored? #488

scottmas opened this issue Dec 9, 2021 · 6 comments

Comments

@scottmas
Copy link

scottmas commented Dec 9, 2021

First off - thank you so much for creating this library! After munging together my own approximate version of this library with custom esbuild and tsc commands chained together in scripts, this has made my life so much easier.

Question though that I can't figure out: Is the declarationMap in tsconfig.json not honored? I can't get the declaration maps to emit in dist. To be clear, I'm not talking about the typescript declaration map itself. But rather, the sourcemap file for the declaration file, so that I can instantly find the actual source file when trying to step into a library.

Thanks!

@egoist
Copy link
Owner

egoist commented Dec 9, 2021

This is not supported, see #311

@egoist egoist closed this as completed Dec 9, 2021
@scottmas
Copy link
Author

scottmas commented Dec 9, 2021

I looked into it, and the underlying reason is b/c the dts rollup plugin doesn't support it. See this thread: Swatinem/rollup-plugin-dts#113. The tldr is that bundling declaration files into a single file is already a very complex task, and adding declarationMap support is even hairier.

The only easy solution that comes to mind would be to add a dumb --tsc flag or similar which will simply invoke tsc with the options defined in the user's tsconfig.json. Does this addition seem in scope and in line with the direction you're looking for this library? To give some context on my use case, I'm developing internal monorepo libraries and its extremely important to be able to step into the actual function definition of the library rather than just its types.

@egoist
Copy link
Owner

egoist commented Dec 9, 2021

The only easy solution that comes to mind would be to add a dumb --tsc flag or similar which will simply invoke tsc with the options defined in the user's tsconfig.json. Does this addition seem in scope and in line with the direction you're looking for this library?

in that case why not just use tsc directly?

@scottmas
Copy link
Author

scottmas commented Dec 9, 2021

Yeah, that's probably the right call until downstream adds support. Thanks for the quick response and thanks for this library!

@0x80
Copy link

0x80 commented May 17, 2023

I also just ran into this issue, but I use path aliases in my packages to map ~ to ./src and tsc doesn't process those, so then another build step is involved and you can not build in watch mode.

This issue is quite old. Maybe there is another solution by now that doesn't involve tsc?

@0x80
Copy link

0x80 commented May 17, 2023

For building in watch mode with tsc this might be an option https://github.com/justkey007/tsc-alias

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

No branches or pull requests

3 participants