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

Comments removed from .d.ts file #176

Open
yankeeinlondon opened this issue Mar 12, 2019 · 2 comments
Open

Comments removed from .d.ts file #176

yankeeinlondon opened this issue Mar 12, 2019 · 2 comments

Comments

@yankeeinlondon
Copy link

When I use bili to transpile my TypeScript source I notice that all comments are stripped from the .d.ts output which is a shame because those comments are part of the typings and can add a lot to library consumers. Is there a way to configure Bili to keep these comments in?

@bbugh
Copy link

bbugh commented Apr 14, 2019

This is because of your project's tsconfig.json settings. TypeScript defaults to removing comments when compiling. This is from the auto-generated tsconfig.json file:

{
  // "removeComments": true,                /* Do not emit comments to output. */
}

Set removeComments to false in your tsconfig.json, and comments won't get removed from your declaration files. If you output min packages, your general comments will be stripped, and only your d.ts comments will be preserved:

yarn bili --format cjs-min --format esm-min

If it bothers you that .d.ts files can have comments removed at all, you can chime in here to lend your support to always keep declaration comments: microsoft/TypeScript#14619

@hosein2398
Copy link
Contributor

This can be closed ?!

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