{"id":25711,"library":"gulp-tsc","title":"gulp-tsc","description":"A gulp plugin that wraps the TypeScript compiler (tsc) to transpile .ts files within gulp workflows. Current stable version is 1.3.2. It supports TypeScript versions from 0.9.1 to 2.1.0, providing a configurable interface for compilation options like module, target, declarations, and source maps. It locates the tsc binary from the local typescript package, shell PATH, or bundled fallback. Compared to alternatives like gulp-typescript, gulp-tsc uses the CLI tsc rather than the compiler API, making it simpler but less flexible for advanced use cases (e.g., no incremental compilation, no project references). The package is lightweight and direct but has limited maintenance and no support for newer TypeScript features.","status":"deprecated","version":"1.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/kant2002/gulp-tsc","tags":["javascript","gulpplugin","typescript","gulp","tsc","compile","transpile","compiler"],"install":[{"cmd":"npm install gulp-tsc","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-tsc","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-tsc","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package uses CommonJS and has no default export; require() is the only way.","wrong":"import typescript from 'gulp-tsc'","symbol":"gulp-tsc","correct":"const typescript = require('gulp-tsc')"},{"note":"The plugin is a simple function, not a class.","wrong":"new typescript()","symbol":"typescript (function)","correct":"typescript()"},{"note":"Options map directly to tsc CLI flags; use CLI-convention names like 'module' and 'target'.","wrong":"typescript({ moduleFormat: 'commonjs' })","symbol":"typescript with options","correct":"typescript({ target: 'ES5', module: 'commonjs' })"}],"quickstart":{"code":"const gulp = require('gulp');\nconst typescript = require('gulp-tsc');\n\ngulp.task('compile', function() {\n  return gulp.src('src/**/*.ts')\n    .pipe(typescript({\n      target: 'ES5',\n      module: 'commonjs',\n      declaration: true\n    }))\n    .pipe(gulp.dest('dist'));\n});","lang":"javascript","description":"Illustrates basic usage of gulp-tsc to compile TypeScript files, with options for ES5 target, CommonJS modules, and declaration generation."},"warnings":[{"fix":"Switch to a maintained alternative like gulp-typescript or use gulp with tsc directly via gulp-shell or similar.","message":"gulp-tsc is no longer actively maintained and only supports TypeScript up to version 2.1. Incompatible with newer TypeScript versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Remove 'allowbool' option; it is not a standard TypeScript compiler flag.","message":"Option 'allowbool' only works with TypeScript 0.9.1.1 and may be ignored in newer versions.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use 'outDir' to set the destination for source maps and declarations, but tsc's --outDir is not directly controlled; specify 'out' or rely on gulp.dest.","message":"The 'outDir' option does not affect the actual tsc output directory; it only modifies paths in the stream.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always set 'outDir' to the same as gulp.dest path when using declarations to ensure correct reference paths.","message":"If 'declaration' is true, generated .d.ts files are included in the stream, but the file paths may be incorrect unless 'outDir' is set to the correct output directory.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use const typescript = require('gulp-tsc') instead of import.","cause":"Incorrect import (ESM import syntax with default import) or missing require.","error":"TypeError: gulp-tsc is not a function"},{"fix":"Run npm install typescript --save-dev to add TypeScript as a dev dependency.","cause":"The typescript package is not installed or not in node_modules.","error":"Error: Cannot find module 'typescript'"},{"fix":"Downgrade TypeScript to version <=2.1.0 or switch to a modern plugin like gulp-typescript.","cause":"The installed TypeScript version is newer than 2.1.0, which gulp-tsc does not support.","error":"TypeScript compiler version mismatch. The compiler API is incompatible."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}