{"id":42148,"library":"tspackage","title":"TsPackage","description":"TsPackage is a TypeScript minifier and modular bundle optimizer that compiles ES6 external TypeScript modules into minified single-file bundles. Version 1.0.0-beta.4 supports TypeScript 2.x and offers identifier shortening, whitespace removal, and cache-optimized incremental builds. It differentiates by bundling dependencies at compilation time rather than relying on downstream build tools like AMD Optimizer. Currently a work in progress, it replaces TsProject. Typically low release cadence as beta.","status":"active","version":"1.0.0-beta.4","language":"javascript","source_language":"en","source_url":"https://github.com/toddthomson/tspackage","tags":["javascript","bundle","bundling","typescript minifier","minify","minification","compiler","cache optimized compiler","incremental build","typescript"],"install":[{"cmd":"npm install tspackage","lang":"bash","label":"npm"},{"cmd":"yarn add tspackage","lang":"bash","label":"yarn"},{"cmd":"pnpm add tspackage","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import; no named exports. Requires ESM.","wrong":"const tspackage = require('tspackage')","symbol":"tspackage","correct":"import tspackage from 'tspackage'"},{"note":"Type-only import to avoid runtime inclusion. Not a value.","wrong":"import { BuildResult } from 'tspackage'","symbol":"BuildResult","correct":"import type { BuildResult } from 'tspackage'"},{"note":"build is a method on the default export, not a named export.","wrong":"build(configPath, settings, callback)","symbol":"tspackage.build","correct":"tspackage.build(configPath, settings, callback)"}],"quickstart":{"code":"import tspackage from 'tspackage';\n\nconst configPath = './tsconfig.json';\nconst settings = {};\n\ntspackage.build(configPath, settings, (result) => {\n  if (!result.Succeeded()) {\n    console.error('Build failed:', result.Errors());\n  } else {\n    console.log('Build succeeded!');\n  }\n});","lang":"typescript","description":"Demonstrates basic usage of tspackage.build with a tsconfig path and callback."},"warnings":[{"fix":"Use TsProject until TsPackage reaches stable release.","message":"TsPackage is a work-in-progress replacement for TsProject; continue using TsProject for now.","severity":"deprecated","affected_versions":">=1.0.0-beta.0"},{"fix":"Use TypeScript 2.x for compatibility.","message":"TsPackage 1.0.0 supports TypeScript 2.x only.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Wrap in a Promise manually or use a callback-based flow.","message":"The API uses a callback pattern and does not return a Promise.","severity":"gotcha","affected_versions":">=1.0.0-beta.0"}],"env_vars":null,"search_vec":"'1.0.0':24 '2':28 'amd':58 'beta':73 'beta.4':25 'build':41,55,86 'bundl':9,22,45,75,76 'cach':38,82 'cache-optim':37 'cadenc':71 'compil':12,48,81,84 'current':60 'depend':46 'differenti':43 'downstream':54 'es6':13 'extern':14 'file':21 'identifi':32 'increment':40,85 'javascript':74 'like':57 'low':69 'minif':80 'minifi':6,18,78,79 'modul':16 'modular':8 'offer':31 'optim':10,39,59,83 'progress':64 'rather':50 'releas':70 'reli':52 'remov':35 'replac':66 'shorten':33 'singl':20 'single-fil':19 'support':26 'time':49 'tool':56 'tspackag':1,2 'tsproject':67 'typescript':5,15,27,77,87 'typic':68 'version':23 'whitespac':34 'work':62 'x':29","created_at":"2026-06-04T18:55:51.096972+00:00","updated_at":"2026-06-04T18:55:51.096972+00:00","problems":[{"fix":"import tspackage from 'tspackage'; then tspackage.build(...)","cause":"Using named import { build } instead of default import.","error":"TypeError: tspackage.build is not a function"},{"fix":"Run `npm install tspackage` and ensure import is './tspackage' if local.","cause":"Missing tspackage dependency or incorrect import path.","error":"error TS2307: Cannot find module 'tspackage'"},{"fix":"Check that configPath is correct and tsconfig.json exists.","cause":"Callback result might be undefined if build fails early.","error":"Error: Cannot read property 'Succeeded' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/toddthomson/tspackage","github":"https://github.com/toddthomson/tspackage","docs":null,"changelog":null,"pypi":null,"npm":"tspackage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}