Registry / devops / typescript-bundle

typescript-bundle

JSON →
library1.0.18jsnpmunverified

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.

npm install typescript-bundle
INSTALL
IMPORT
SIG · TYPESCRIPT-BUNDLE
T
typescript-bundle
devopsjavascriptv1.0.18
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.

CLI usage
npx tsc-bundle index.ts
tsc-bundle index.ts (without npx, if not globally installed)
CLI tool invoked via npx or global install.
text asset import
import Text from 'text!./file.txt'
import Text from './file.txt'
Must prefix with 'text!' to embed asset as string.
json asset import
import Obj from 'json!./file.json'
import * as Obj from './file.json'
Use 'json!' prefix to embed as JSON object; not a regular module.
base64 asset import
import Base64 from 'base64!./image.png'
import image from './image.png'
Embed as base64-encoded string using 'base64!' prefix.

Bundle a simple TypeScript module with tsc-bundle into a single JavaScript file.

// Hello.ts export function hello(name: string): string { return `Hello, ${name}!`; } // index.ts import { hello } from './Hello'; const msg = hello('world'); console.log(msg); // Command line: // npx typescript-bundle index.ts --outFile bundle.js // Bundle to bundle.js, then run in browser or Node.
typescript-bundle --version
Debug
Known issues
gotchaAsset imports (text!, json!, etc.) require TypeScript compiler version 2.2.0 or higher.
fix
Upgrade TypeScript to >=2.2.0 or avoid asset imports.
affects: <2.2.0
gotchaThe bundle output is not minified; you must use a separate minifier for production.
fix
Run output through terser or uglify-js.
affects: >=1.0.0
breakingCLI options are case-sensitive and must be in proper order.
fix
Use options as documented: --outFile, --target, etc.
affects: >=1.0.0
gotchaWhen using tsconfig.json, the files array must include all entry points.
fix
Add all entry .ts files to the files array in tsconfig.json.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'text!./file.txt'
TypeScript doesn't understand the 'text!' prefix without a declaration file.
fix
Add a declaration file (e.g., globals.d.ts) with: declare module '*.txt' { const content: string; export default content; }
error TS2304: Cannot find name 'require'
Using Node.js require() in a browser bundle.
fix
Use ES module import/export syntax instead of CommonJS.
ENOENT: no such file or directory, open './script.ts'
The specified input file does not exist or path is incorrect.
fix
Double-check the file path; use absolute path or correct relative path.
Upgrade
Version history
1.0.18latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources
typescript-bundle — npm install typescript-bundle · libregistry