ts-project-bundle is an experimental command-line interface (CLI) tool designed to simplify the bundling of TypeScript projects that leverage TypeScript's project references feature. Versioned at 0.0.12 and explicitly marked as a "prototype," it offers a basic mechanism to combine a main TypeScript project and its declared library dependencies into a single output directory, preserving their relative folder structure. Unlike full-featured bundlers such as Webpack or Rollup, ts-project-bundle focuses on the compilation and file restructuring aspects, relying on `tsc --build` for the initial compilation phase. Its primary differentiator is its direct integration with TypeScript project references, aiming to provide a lightweight solution for consolidating compiled output, particularly useful in monorepo environments where multiple interdependent TypeScript packages need to be deployed together. The tool's development appears to have ceased, with no significant updates since late 2022, indicating an abandoned status.
npm install ts-project-bundleVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install and run `ts-project-bundle` on a minimal TypeScript project leveraging project references, compiling and consolidating its output into a single directory structure.
Use with caution for experimental purposes only. Do not rely on it for critical applications.
Consider alternatives for robust bundling solutions like `esbuild`, `Rollup.js`, or `Webpack` that are actively maintained. If used, be prepared to fork and maintain the codebase yourself.
Ensure your TypeScript projects are properly configured with project references and `tsconfig.json` files in all relevant directories.
Always execute `npx tsc --build` in your main project directory before running `ts-project-bundle` to ensure all dependencies are built.
Ensure the directory where `ts-project-bundle` is run, or the directory specified by `--project`, contains a valid `tsconfig.json` file.
Verify that your main project's `tsconfig.json` includes valid `references` to its dependent TypeScript libraries, ensuring all paths are correct.
Address any compilation errors reported by `tsc --build` before attempting to bundle. Ensure all projects compile successfully independently.
Carefully review the `--root` and `--project` arguments to ensure they correctly point to the monorepo root and the main project directory, respectively, relative to where the command is executed.