Registry / devops / tsproject

tsproject

JSON →
library4.1.0-dev.1jsnpmunverified

TsProject is a TypeScript minifier and modular bundle optimizer that integrates with Gulp via Vinyl streams. It compiles TypeScript project configuration files (tsconfig.json) and supports ES6 module bundling, minification with identifier shortening, and cache-optimized incremental builds. Current stable version is 2.0.2 (latest release), with a v4.0.0 beta (4.1.0-dev.1) targeting TypeScript 4.0. Release cadence is infrequent, with major version bumps aligned to TypeScript releases. Key differentiators include native bundle support within tsconfig.json and compile-time bundling, unlike tools like r.js or Webpack. Requires Node >=14, ships TypeScript types, and is primarily used as a Gulp plugin.

npm install tsproject
INSTALL
IMPORT
SIG · TSPROJECT
T
tsproject
devopsjavascriptv4.1.0-dev.1
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.

tsproject
✓ var tsproject = require('tsproject');
✗ import tsproject from 'tsproject';
TsProject exposes a CommonJS module; default import is the function. ESM import may not work due to lack of module field in package.json.
src
✓ tsproject.src('./path/to/project');
✗ tsproject('./path/to/project');
The main export is an object with a 'src' method; calling it directly as a function is incorrect.
tsproject.src
✓ tsproject.src(configPath, options);
The src method takes a path string and an optional settings object.

Demonstrates a basic Gulp task using tsproject to compile TypeScript from a directory with tsconfig.json.

var tsproject = require('tsproject'); var gulp = require('gulp'); gulp.task('build', function() { return tsproject.src('./src', { logLevel: 1, compileOptions: { target: 'ES5', module: 'commonjs' } }) .pipe(gulp.dest('./dist')); });
Debug
Known issues
breakingTsProject v4.0.0 requires TypeScript 4.0+ and Node >=14; older Node versions break.
fix
Upgrade Node to 14+ and TypeScript to 4.0+.
affects: >=4.0.0
deprecatedTsProject v2.0.2 is the last stable release; v4.0.0-dev.1 is beta and may have breaking changes.
fix
Use v2.0.2 for stability or test with v4.0.0-dev.1 for TypeScript 4.0 support.
affects: >=2.0.2 <4.0.0
gotchaTsProject only supports CommonJS via require(). ESM imports may fail due to lack of ESM module field.
fix
Use require() syntax in Node.js; avoid import statements.
affects: all
gotchaBundles defined in tsconfig.json require 'files' property to be present; missing files causes empty output.
fix
Ensure tsconfig.json includes both 'files' and 'bundles' sections.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'tsproject'
tsproject is not installed or not in node_modules.
fix
Run 'npm install tsproject --save-dev' and ensure it's in the same directory as your gulpfile.
TypeError: tsproject is not a function
Using import or calling the export as a function instead of using tsproject.src.
fix
Use 'var tsproject = require('tsproject');' and call 'tsproject.src(...)'.
Error: Cannot read property 'src' of undefined
Incorrect require path or missing default export.
fix
Ensure require('tsproject') returns an object with 'src' method; check node_modules/tsproject/index.js.
Error: No tsconfig.json found
The path provided to tsproject.src does not contain a tsconfig.json file.
fix
Verify the path points to a directory or file that includes a valid tsconfig.json.
Upgrade
Version history
4.1.0-dev.1latest on npm
Audit
Dependencies
gulprequiredTsProject is a Gulp plugin that returns a Vinyl stream; Gulp is required in the build pipeline.
typescriptrequiredTsProject compiles TypeScript; peer dependency for version alignment.
Agent activity
8 hits · last 30 days
node
8
Resources
tsproject — npm install tsproject · libregistry