{"id":26547,"library":"typescript-closure-compiler","title":"typescript-closure-compiler","description":"Patches the TypeScript compiler to generate JSDoc annotations for Google Closure Compiler integration. Stable version 1.8.11 is compatible with TypeScript 1.8.10. Release cadence matches TypeScript major.minor versions. This package is a niche tool specifically for combining TypeScript with Closure Compiler's advanced optimizations, unlike general-purpose TypeScript compilers. It provides a CLI command `tscc` that replaces `tsc` and adds options for entry points, exports, and externs. Not actively maintained; last release in 2016. Users should be aware of TypeScript version lock-in and potential issues with modern TypeScript features.","status":"abandoned","version":"1.8.11","language":"javascript","source_language":"en","source_url":"https://github.com/sagifogel/typescript-closure-compiler","tags":["javascript","TypeScript","minifier","closure","compiler","language"],"install":[{"cmd":"npm install typescript-closure-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-closure-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-closure-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The patched compiler is built on TypeScript 1.8.10 and may not work with other versions.","package":"typescript","optional":false}],"imports":[{"note":"CLI tool; install globally or use npx. Not a library import.","wrong":"npm install -g typescript-closure-compiler && tscc app.ts","symbol":"tscc","correct":"npx tscc app.ts"},{"note":"Package does not export any JavaScript API; only CLI.","wrong":"import { compile } from 'typescript-closure-compiler'","symbol":"default export (none)","correct":"No programmatic API exposed; use CLI or gulp plugin."},{"note":"Separate gulp plugin package, not this package.","wrong":"import gulpTscc from 'typescript-closure-compiler'","symbol":"gulp-typescript-closure-compiler","correct":"const gulpTscc = require('gulp-typescript-closure-compiler')"}],"quickstart":{"code":"// Install globally\nnpm install -g typescript-closure-compiler\n\n// Compile a TypeScript file\ntscc app.ts\n\n// With options: entry point and export name\ntscc app.ts --module commonjs --entry app.ts --exportAs App\n\n// Using tsconfig.json with externs\n// tsconfig.json:\n{\n  \"compilerOptions\": { \"module\": \"commonjs\" },\n  \"files\": [\"app.ts\"],\n  \"externs\": [\"externs/app-externs.d.ts\"],\n  \"externsOutFile\": \"externs.js\"\n}\n// Then run:\ntscc --project .","lang":"javascript","description":"Demonstrates installation, basic usage, common options (entry, export, externs), and tsconfig.json usage for the tscc CLI."},"warnings":[{"fix":"Pin to TypeScript 1.8.x; do not upgrade TypeScript without upgrading this package.","message":"Package is compatible only with TypeScript 1.8.10. Using with newer TypeScript versions will likely break.","severity":"breaking","affected_versions":">=2.0"},{"fix":"Consider alternatives like tsickle or direct Closure Compiler usage.","message":"Project appears abandoned; last release 2016, no updates since.","severity":"deprecated","affected_versions":"all"},{"fix":"Do not rely on module syntax in output; code will be concatenated into a single file without module wrappers.","message":"The --module flag is only for compilation; modules are not preserved in output because all code is bundled into one file.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install -g typescript@1.8.10' alongside typescript-closure-compiler.","cause":"typescript-closure-compiler requires TypeScript 1.8.10 installed in the same directory or globally.","error":"Error: Cannot find module 'typescript'"},{"fix":"Use 'tscc' command instead of 'tsc' when employing package-specific options.","cause":"Using typescript-closure-compiler (tscc) instead of tsc? The option 'externs' is only supported by tscc.","error":"error TS5023: Unknown compiler option 'externs'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}