ToddThomson / tsproject

Typescript minifier and modular typescript bundle optimizer for gulp (Ts Vinyl Adapter).
Other
57 stars 12 forks source link

When bundling only include the source code for referenced named bindings in imports #97

Closed ToddThomson closed 8 years ago

ToddThomson commented 8 years ago

Right now TsProject bundles the the entire source file from imported modules. While working on issue #93 it seems as though this is not really necessary. We should be able to utilize the named bindings in the import to selectively add only the source code for the individual named bindings.

ToddThomson commented 8 years ago

Can this optimization also be applied to included external libraries if their source code is provided. It seems likely as javascript sources are processed the same as ts sources. This would require external library dependency graphs to be created by the bundler.

ToddThomson commented 8 years ago

in practice I only really use a single export per module so this would not be a benefit to me or I would guess anyone else. I must have been a bit tired yesterday afternoon!