TS Bundle is a package bundler designed for TypeScript projects, aggregating multiple TypeScript files into a single output file. It is particularly useful for packaging library components, leveraging `references.d.ts` files to determine file order and dependencies. The current stable version, `0.3.0`, was last published over eight years ago, indicating that the project is no longer actively maintained. Its core functionality involves consolidating source files, optionally wrapping them in a specified root module, and enabling the inclusion of license headers. It provides a `preSave` hook for final output manipulation and an option to disable TSLint on the generated bundle. This tool predates modern bundlers like Webpack, Rollup, or esbuild, which offer more sophisticated features and better integration with contemporary TypeScript and JavaScript ecosystems.
npm install ts-bundleVerified import paths — ran on the pinned version, not inferred.
Bundles a TypeScript entry file (`src/main.ts`) into a single output (`dist/my-library.ts`), demonstrating configuration options like root module, license inclusion, and versioning.
For new projects or projects requiring modern TypeScript features, consider migrating to actively maintained and modern bundlers such as Webpack, Rollup, esbuild, or Parcel. These tools offer robust support for current language features and ecosystems.
Carefully review and maintain your `references.d.ts` file(s), ensuring all dependent files are correctly referenced and ordered. Ensure the `src` option points to the correct entry point that properly cascades references.
For optimized bundle sizes, better performance, and advanced bundling capabilities, it is strongly recommended to use modern bundlers. If you must use `ts-bundle`, external tools would be required for further optimization steps like minification.
Transition your build pipeline to modern, actively maintained bundlers such as Webpack, Rollup, esbuild, or Parcel. These alternatives provide superior support, performance, and features for current development practices and future-proofing.
Verify that the path specified for `src` is correct and relative to where the `ts-bundle` script is executed, or provide an absolute path to the file.
Use `const bundle = require('ts-bundle');` for CommonJS or `import bundle from 'ts-bundle';` for ESM interop to correctly import the bundling function, as the module itself is the function.Ensure that all required TypeScript declarations are available and correctly referenced via `/// <reference path="..." />`. If you are using very new TypeScript syntax or features, `ts-bundle` may not support them; in such cases, consider upgrading your bundler or migrating to a modern alternative.
No dependency data recorded yet.