{"id":27480,"library":"tsproject","title":"tsproject","description":"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.","status":"maintenance","version":"4.1.0-dev.1","language":"javascript","source_language":"en","source_url":"https://github.com/toddthomson/tsproject","tags":["javascript","typescript","bundle","bundling","minifier","minify","minification","compiler","cache optimized compiler"],"install":[{"cmd":"npm install tsproject","lang":"bash","label":"npm"},{"cmd":"yarn add tsproject","lang":"bash","label":"yarn"},{"cmd":"pnpm add tsproject","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"TsProject is a Gulp plugin that returns a Vinyl stream; Gulp is required in the build pipeline.","package":"gulp","optional":false},{"reason":"TsProject compiles TypeScript; peer dependency for version alignment.","package":"typescript","optional":false}],"imports":[{"note":"TsProject exposes a CommonJS module; default import is the function. ESM import may not work due to lack of module field in package.json.","wrong":"import tsproject from 'tsproject';","symbol":"tsproject","correct":"var tsproject = require('tsproject');"},{"note":"The main export is an object with a 'src' method; calling it directly as a function is incorrect.","wrong":"tsproject('./path/to/project');","symbol":"src","correct":"tsproject.src('./path/to/project');"},{"note":"The src method takes a path string and an optional settings object.","wrong":null,"symbol":"tsproject.src","correct":"tsproject.src(configPath, options);"}],"quickstart":{"code":"var tsproject = require('tsproject');\nvar gulp = require('gulp');\n\ngulp.task('build', function() {\n    return tsproject.src('./src', {\n        logLevel: 1,\n        compileOptions: {\n            target: 'ES5',\n            module: 'commonjs'\n        }\n    })\n    .pipe(gulp.dest('./dist'));\n});","lang":"javascript","description":"Demonstrates a basic Gulp task using tsproject to compile TypeScript from a directory with tsconfig.json."},"warnings":[{"fix":"Upgrade Node to 14+ and TypeScript to 4.0+.","message":"TsProject v4.0.0 requires TypeScript 4.0+ and Node >=14; older Node versions break.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use v2.0.2 for stability or test with v4.0.0-dev.1 for TypeScript 4.0 support.","message":"TsProject v2.0.2 is the last stable release; v4.0.0-dev.1 is beta and may have breaking changes.","severity":"deprecated","affected_versions":">=2.0.2 <4.0.0"},{"fix":"Use require() syntax in Node.js; avoid import statements.","message":"TsProject only supports CommonJS via require(). ESM imports may fail due to lack of ESM module field.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure tsconfig.json includes both 'files' and 'bundles' sections.","message":"Bundles defined in tsconfig.json require 'files' property to be present; missing files causes empty output.","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":"Run 'npm install tsproject --save-dev' and ensure it's in the same directory as your gulpfile.","cause":"tsproject is not installed or not in node_modules.","error":"Error: Cannot find module 'tsproject'"},{"fix":"Use 'var tsproject = require('tsproject');' and call 'tsproject.src(...)'.","cause":"Using import or calling the export as a function instead of using tsproject.src.","error":"TypeError: tsproject is not a function"},{"fix":"Ensure require('tsproject') returns an object with 'src' method; check node_modules/tsproject/index.js.","cause":"Incorrect require path or missing default export.","error":"Error: Cannot read property 'src' of undefined"},{"fix":"Verify the path points to a directory or file that includes a valid tsconfig.json.","cause":"The path provided to tsproject.src does not contain a tsconfig.json file.","error":"Error: No tsconfig.json found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}