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

Overhead code generation for outFile #27679

Closed
pankleks opened this issue Oct 10, 2018 · 2 comments
Closed

Overhead code generation for outFile #27679

pankleks opened this issue Oct 10, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@pankleks
Copy link

pankleks commented Oct 10, 2018

I'm compiling my project to single output file using outFile option.

TSC is generating overhead code as such:
image

This happens for every file of my solution -> in my case hundreds of small files which cause significant overhead in output file.

I believe this could be optimized by merging objects in same namespace.

Test solution:
testmerge.zip

TSC v: 3.1.1 but I believe it was like this since very beginning.

@ajafff
Copy link
Contributor

ajafff commented Oct 10, 2018

This is actually really difficult because each namespace can have local declarations (variables, functions, ...). These names would need to be rewritten to avoid collisions. After all I don't think it's worth the effort.
You could try some minifiers on the generated file to get rid of the duplicate code.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 10, 2018
@RyanCavanaugh
Copy link
Member

Duplicate #447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants