Zshy (pronounced "zee-shy") is a bundler-free build tool specifically designed for TypeScript libraries, leveraging `tsc` for core transpilation. It aims to simplify the build process by requiring no separate configuration file, instead inferring settings from `package.json` and `tsconfig.json`. Key features include declarative entrypoint mapping within `package.json#/zshy`, automatic generation of `"exports"` and `"jsr.json"` fields, and native support for dual-module builds (ESM and CJS) from a single TypeScript source. It currently stands at version 0.7.0, with an active development pace indicated by frequent releases, and differentiates itself by its `tsc`-powered, no-bundler, no-config philosophy, making it an ideal choice for straightforward TypeScript library projects needing robust dual-package support without the complexity of traditional bundlers.
npm install zshyVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install `zshy` and configure a multi-entrypoint TypeScript library build using the `zshy` field in `package.json`.
Ensure your project's `typescript` dependency is updated to `5.5.0` or newer (e.g., `npm install typescript@latest`).
Manage your package exports exclusively through the `zshy` field in `package.json`. Avoid direct edits to `exports` or `jsr.json`.
Factor build times into your CI/CD pipeline and local development workflow. Consider `zshy`'s trade-off of simplicity and `tsc` correctness against raw build speed.
Upgrade to `zshy` v0.4.4 or newer to ensure correct CJS default export behavior with named types. Review your `package.json` `type` field for correct ESM/CJS indications.
Ensure your `tsconfig.json`'s `composite` setting aligns with your project's needs. If encountering issues related to project references, consult `zshy` documentation or issue tracker for specific `tsconfig` overrides.
Upgrade your project's TypeScript dependency: `npm install typescript@latest` or `yarn add typescript@latest --dev`.
Navigate to your project's root directory and rerun `npx zshy`.
Add or correct the `"zshy"` field in `package.json` to specify your library's entrypoints, either as a single string path or an `exports` object.
Ensure your Node.js runtime environment and the `package.json#type` field correctly align with the module format you are trying to execute. For CJS, ensure `type` is not 'module' or use `.cjs` extension. For ESM, ensure `type` is 'module' or use `.mjs`.