A TypeScript code minifier leveraging the TypeScript compiler (v1.3.1, stable, quarterly releases) to safely rename variables, classes, functions, properties, and methods to short forms. Unlike general minifiers (e.g., terser), it fully understands TypeScript semantics and respects type safety, preserving exports and type declarations while achieving maximum compression. Key differentiators: AST-based renaming with no risk of breaking type inference, compatible with any TypeScript project, and produces valid JavaScript/TypeScript output.
npm install minify-tsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minifies a TypeScript string with mangling enabled, outputting as JavaScript. Writes result to file and prints size.
Use Node 14+ or stay on v1.2.x
Replace 'compress: true' with 'mangle: true' and use 'map: true' instead of 'sourcemap: true'
Run tsc --noEmit before minifying to catch syntax errors
Switch to ES import: import minifyTS from 'minify-ts'
Run npm install minify-ts
Ensure all TypeScript syntax is valid and set output to 'ts' if preserving types
No dependency data recorded yet.