-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Support --declarationOutFile
for bundling declarations for commonjs and es6 modules
#8372
Comments
Suggestion: Separate what webpack does with what tsc does:
This way your published module should contain : I might be wrong 🌹 |
Does my sample in #8305 (comment) address the issue? if no, why not? |
@mhegazy not exactly. Your sample shows how to consume npm-libraries. As a library developer, using webpack to bundle, what is the best process to expose modules that "match" the folder listing and at the same time generate a single .d.ts file that includes the definitions for these bundled javascript modules. |
i see. that is not a supported feature now. i would assume you want to have a |
Yes, I think that is accurate. I think this is a common workflow, where TS developers will bundle a production bundle but still want to provide a Happy to take advice on other alternatives. |
--declarationOutFile
for bundling declarations for commonjs and es6 modules
thanks, updating the title to reflect the request. PRs are welcomed. |
Any updates on this? |
I'm just realizing that Typescript isn't very node.js developer friendly. |
curious to know why is that. |
@mhegazy I came to this issue thinking something similar, but that TypeScript is not very JS library developer friendly. It is not easy or obvious how to create a single The issue here for developers of web libraries is the other side of that coin. If I want to create a single |
Any update on this? |
The issue is marked as |
Monthly checking for any updates on this :) |
Pwetty pwetty pweaseee |
New year update? |
Closing as a dupe of #4433 |
This is very similar to #8305.
In our world we are using webpack to bundle our typescript library which has many levels of nesting. For example:
At the moment our current approach is to export everything into one top-level index.ts which means consumers lose the nesting and we have to write the .d.ts files ourselves
Ideally we'd like consumers to import modules like this (and avoid a single index.ts file at the top level that exports everything in a non-nested structure):
However it is not obvious from the documentation how to write a .d.ts file that supports this layout when this is how the webpack bundle is structured. As a second part, how can I have TS auto-generate the .d.ts files for us so that we can have a single definition file for our bundled JS
The text was updated successfully, but these errors were encountered: