Closure Compiler + Typescript

Viewed 7685

I want to use Typescript and then Closure Compile (advanced compilation) to target ES5 and minify the output.

Do I have to use tsickle in place of tsc? It lacks support for all the options tsc has, and is far ambitious in that it wants to translate Typescript types to Closure types (which are not 100% compatible). I don't really need to use Closure types; I just need minification/property renaming.

Can I use tsc to compile Typescript to ES6 modules and use Closure Compiler to minify those (without type checking or type-based optimzations)?

Bonus: Does this answer change if I want to use Closure Library?

2 Answers

I realize I'm late to the party, but regarding the Closure library: There now is an active fork of an up-to-date version of the Closure library that has

  • Typescript definition (.d.ts) files
  • uses ES6 code instead of the custom goog.require, goog.define internally (so has no dependency on the Closure compiler)
Related