s-panferov / awesome-typescript-loader

Awesome TypeScript loader for webpack
Other
2.35k stars 181 forks source link

Enhancement: Implement Tsickle for Google Closure Compiler #153

Open TheLarkInn opened 8 years ago

TheLarkInn commented 8 years ago

Currently there is an angular project which I think could benefit all Typescript users.

As we all know, Google closure compiler is still the most efficient minifier, however requires annotations for it to be used in ADVANCED mode.

https://github.com/angular/tsickle

This project is using a baked tsc that automagically converts decorators and types to annotations that allow for GCC to understand.

Since Webpack2 is implementing LoaderOptionsPlugin which hands the responsibilities of minifying to the loader, it would be perfect timing to add a minify feature into the loader.

Thoughts?

s-panferov commented 8 years ago

@TheLarkInn do you have any concerns about just using additional loader such as https://www.npmjs.com/package/webpack-closure-compiler or any analog?

TheLarkInn commented 8 years ago

@s-panferov not a problem at all. I'm using it currently anyways minification over UglifyJsPlugin in SIMPLE mode but adding the annotations is a step that has to happen during the transpilation process (which Tsickle does) so GCC can perform tree-shaking and dead code elimination (ADVANCED mode).

niieani commented 8 years ago

This would be fantastic! Using Closure Compiler instead of Babel as the second step of TS compilation with tsickle's annotations would make this the best TS->JS workflow to date. 🎆

CSchulz commented 7 years ago

Is there anything open to get this implemented?

stefan-leye commented 7 years ago

+1

ianks commented 7 years ago

How would this integrate with JS code? Would GCC just be used for the typescript files then be bundled by webpack?

Lonli-Lokli commented 7 years ago

webpack-closure-compiler plugin is not supported, will this feature be implemented?