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

Emit and bundle the definitions? #49

Closed
JasonKleban opened this issue Sep 10, 2017 · 3 comments
Closed

Emit and bundle the definitions? #49

JasonKleban opened this issue Sep 10, 2017 · 3 comments

Comments

@JasonKleban
Copy link

I'm using webpack 3, ts-loader, and transpileOnly: true along with this fork-ts-checker-webpack-plugin.

My ts-config.json has "declaration": true, but I don't think I'm getting the type definitions because of transpileOnly: true which makes sense to me, since I didn't allow ts-loader to perform the computation of the types.

If that's the true cause, is there a way to output the definitions computed during this ts-checker phase? And is there a way to further bundle those definitions as webpack already does for the output .js file?

Thanks!

@johnnyreilly
Copy link
Member

Personally I've never used webpack in combination with "declaration": true and so I may not be fully understanding your setup. but Would it work if you had a separate process that generated the type definitions. So, another npm script that you used to just run tsc against to generate *.d.ts files? Just a thought... (not necessarily a useful one)

@piotr-oles
Copy link
Collaborator

I've just checked typescript.d.ts and there is a method:

emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;

on Program class.
The fourth argument called emitOnlyDtsFiles might be something you are interested in. I don't have a time to implement this in near future so PR's are welcome :)

@stale
Copy link

stale bot commented May 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 20, 2019
@stale stale bot closed this as completed Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants