-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
declarationMap
option in svelte-package
#7793
Comments
What's the use case for distributing your source code along the compiled js/dts files? Where in the wild does that happen already? |
It doesn't happen in the wild very much unfortunately because no one even knows about this feature. But it's so much more useful to be able to go to a function's source code than its type declaration or its compiled js. I'm sure if more people knew about it, it would be more common. I do it with all my packages |
Dug into this. Turning in
The first one is a proper bug on our side which needs fixing. The second one is a general TypeScript problem, that behavior is not configurable (there's an open issue on the TS tracker for it). The question is if we somehow smooth over it by copying over the sources, too, if we detect that the user wants this, or if it's in the hands of the developer to do the right thing there (not publishing the |
The use case we are facing is in a monorepo where packages are referencing each other via #8843 was addressing exactly that issue but was closed in favor of another PR which did not actually fix anything described in this issue. |
Describe the problem
tsc
has adeclarationMap
compiler option, which is useful for libraries that distribute their source code along with the compiled.js
/.d.ts
files as it allows IDEs to navigate to the source code when ctrl+clicking imported symbols. see https://www.typescriptlang.org/tsconfig#declarationMapDescribe the proposed solution
a
declarationMap
option forsvelte-package
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: