Registry / devops / gulp-tsc

gulp-tsc

JSON →
library1.3.2jsnpmunverified

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.

npm install gulp-tsc
INSTALL
IMPORT
SIG · GULP-TSC
G
gulp-tsc
devopsjavascriptv1.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gulp-tsc
const typescript = require('gulp-tsc')
import typescript from 'gulp-tsc'
This package uses CommonJS and has no default export; require() is the only way.
typescript (function)
typescript()
new typescript()
The plugin is a simple function, not a class.
typescript with options
typescript({ target: 'ES5', module: 'commonjs' })
typescript({ moduleFormat: 'commonjs' })
Options map directly to tsc CLI flags; use CLI-convention names like 'module' and 'target'.

Illustrates basic usage of gulp-tsc to compile TypeScript files, with options for ES5 target, CommonJS modules, and declaration generation.

const gulp = require('gulp'); const typescript = require('gulp-tsc'); gulp.task('compile', function() { return gulp.src('src/**/*.ts') .pipe(typescript({ target: 'ES5', module: 'commonjs', declaration: true })) .pipe(gulp.dest('dist')); });
Debug
Known issues
deprecatedgulp-tsc is no longer actively maintained and only supports TypeScript up to version 2.1. Incompatible with newer TypeScript versions.
fix
Switch to a maintained alternative like gulp-typescript or use gulp with tsc directly via gulp-shell or similar.
affects: >=1.0.0
breakingOption 'allowbool' only works with TypeScript 0.9.1.1 and may be ignored in newer versions.
fix
Remove 'allowbool' option; it is not a standard TypeScript compiler flag.
affects: >=1.0.0
gotchaThe 'outDir' option does not affect the actual tsc output directory; it only modifies paths in the stream.
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.
affects: >=1.0.0
gotchaIf '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.
fix
Always set 'outDir' to the same as gulp.dest path when using declarations to ensure correct reference paths.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: gulp-tsc is not a function
Incorrect import (ESM import syntax with default import) or missing require.
fix
Use const typescript = require('gulp-tsc') instead of import.
Error: Cannot find module 'typescript'
The typescript package is not installed or not in node_modules.
fix
Run npm install typescript --save-dev to add TypeScript as a dev dependency.
TypeScript compiler version mismatch. The compiler API is incompatible.
The installed TypeScript version is newer than 2.1.0, which gulp-tsc does not support.
fix
Downgrade TypeScript to version <=2.1.0 or switch to a modern plugin like gulp-typescript.
Upgrade
Version history
1.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
gulp-tsc — npm install gulp-tsc · libregistry