Skip to content

--removeComments in JS only #13318

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

Closed
unional opened this issue Jan 6, 2017 · 1 comment
Closed

--removeComments in JS only #13318

unional opened this issue Jan 6, 2017 · 1 comment
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript

Comments

@unional
Copy link
Contributor

unional commented Jan 6, 2017

tsc: 2.2.0+

I try to preserve comments in typings files but remove comments in the transpiled JS file. Couldn't find a combination to do it.

One way is introducing a flag for it, but it would be overkill.
Another way is to emit typings files when --declaration=true and --noEmit=true, the draw back is I have to run tsc twice with different config to generate the comment removed JS files and comment retained typings files.

@mhegazy
Copy link
Contributor

mhegazy commented May 11, 2017

We have discussed this issue before; every new option combination has its cost in terms of complexity and maintenance costs, so we have limited budget for adding new switches/switch combinations.
--removeComments has a clear functionality, it removes comments from both .js and .d.ts. if you do not care about comments, seems reasonable to remove them from both, if you do, it is not clear why you would not keep them in .js files. any JS minifier would remove comments for you, and presumably you are already using a minifier.

@mhegazy mhegazy added Suggestion An idea for TypeScript Declined The issue was declined as something which matches the TypeScript vision labels May 11, 2017
@mhegazy mhegazy closed this as completed May 11, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants