{"id":28426,"library":"typescript-bundle","title":"TypeScript-Bundle","description":"A zero-configuration CLI tool for bundling TypeScript source code into a single JavaScript file for browser consumption. Version 1.0.18 supports bundling from .ts, .tsx, or tsconfig.json, with features like asset embedding (text, JSON, base64, buffer, CSS), custom transform pipelines, and global export/injection. It differs from webpack/rollup by focusing solely on TypeScript bundling without configuration, and can work with TypeScript compiler versions as low as 1.8.0. The project appears to be in maintenance mode with no recent releases.","status":"maintenance","version":"1.0.18","language":"javascript","source_language":"en","source_url":"https://github.com/sinclairzx81/typescript-bundle","tags":["javascript","typescript","bundle"],"install":[{"cmd":"npm install typescript-bundle","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-bundle","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-bundle","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CLI tool invoked via npx or global install.","wrong":"tsc-bundle index.ts (without npx, if not globally installed)","symbol":"CLI usage","correct":"npx tsc-bundle index.ts"},{"note":"Must prefix with 'text!' to embed asset as string.","wrong":"import Text from './file.txt'","symbol":"text asset import","correct":"import Text from 'text!./file.txt'"},{"note":"Use 'json!' prefix to embed as JSON object; not a regular module.","wrong":"import * as Obj from './file.json'","symbol":"json asset import","correct":"import Obj from 'json!./file.json'"},{"note":"Embed as base64-encoded string using 'base64!' prefix.","wrong":"import image from './image.png'","symbol":"base64 asset import","correct":"import Base64 from 'base64!./image.png'"}],"quickstart":{"code":"// Hello.ts\nexport function hello(name: string): string {\n  return `Hello, ${name}!`;\n}\n\n// index.ts\nimport { hello } from './Hello';\nconst msg = hello('world');\nconsole.log(msg);\n\n// Command line:\n// npx typescript-bundle index.ts --outFile bundle.js\n// Bundle to bundle.js, then run in browser or Node.","lang":"typescript","description":"Bundle a simple TypeScript module with tsc-bundle into a single JavaScript file."},"warnings":[{"fix":"Upgrade TypeScript to >=2.2.0 or avoid asset imports.","message":"Asset imports (text!, json!, etc.) require TypeScript compiler version 2.2.0 or higher.","severity":"gotcha","affected_versions":"<2.2.0"},{"fix":"Run output through terser or uglify-js.","message":"The bundle output is not minified; you must use a separate minifier for production.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use options as documented: --outFile, --target, etc.","message":"CLI options are case-sensitive and must be in proper order.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Add all entry .ts files to the files array in tsconfig.json.","message":"When using tsconfig.json, the files array must include all entry points.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Add a declaration file (e.g., globals.d.ts) with: declare module '*.txt' { const content: string; export default content; }","cause":"TypeScript doesn't understand the 'text!' prefix without a declaration file.","error":"Cannot find module 'text!./file.txt'"},{"fix":"Use ES module import/export syntax instead of CommonJS.","cause":"Using Node.js require() in a browser bundle.","error":"error TS2304: Cannot find name 'require'"},{"fix":"Double-check the file path; use absolute path or correct relative path.","cause":"The specified input file does not exist or path is incorrect.","error":"ENOENT: no such file or directory, open './script.ts'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}