evilrefa.blogg.se

Tsc minify
Tsc minify













tsc minify

#Tsc minify code#

We usually process the TypeScript code with many tools in pipelines, many of them may generate SourceMap files for debugging use, but these SourceMap files are mapped to the files generated in the previous step, not the original one. The minify-ts uses TypeScript compiler to find out the safe way and smartly keeps the exports unchanged in your specified files: the exported variables, functions, classes and their public members. Keeping their names unchanged will also affect another goal: protect your source code. In another hand, more people like to write code with classes in TypeScript, so more properties and methods are involved. So generally they just leave it unchanged, which stops them achieve the smaller minified size. Popular traditional minifiers are mostly based on JavaScript, as a result, they cannot get the information of types to decide whether a property name can be changed safely or not.

tsc minify

It also provides a useful feature: merge the SourceMap files generated in several steps, and overwrite the last one with the merged one. A TypeScript minifier based on TypeScript compiler to safely rename all of the variables, classes, functions, properties and methods to short.















Tsc minify