tsc-alias is a utility designed to resolve TypeScript's `paths` aliases into relative paths *after* TypeScript compilation has completed. This ensures that the compiled JavaScript files can be run directly without requiring additional runtime modules like `tsconfig-paths`, distinguishing it through its compile-time-only approach. The package is currently at version `1.8.16` (as of May 2025) and maintains an active release cadence with frequent patches addressing compatibility and bug fixes. It is typically integrated into `package.json` build scripts alongside `tsc`, providing a robust solution for managing complex module import structures in both Node.js and browser environments. It ships with TypeScript types and requires Node.js `^16.20.2` or later.
npm install tsc-aliasVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to configure and run `tsc-alias` with TypeScript aliases in a build script.
Remove the `--silent` flag from CLI commands or the `silent` property from API options. Use `verbose` or `debug` for controlling output.
Ensure your build script correctly orders `tsc` before `tsc-alias`, typically using `&&` for sequential execution, e.g., `tsc && tsc-alias`.
Upgrade tsc-alias to version `1.8.13` or newer to ensure full compatibility with Node.js 20+ environments.
Upgrade to tsc-alias v1.8.14 or newer. Always explicitly pass the project config with `-p tsconfig.json`.
This is expected and desired behavior. No fix is required unless you had a specific, non-standard workflow relying on `.d.ts` replacement (which is generally not recommended).
Add `"outDir": "./dist"` (or your desired output directory) to your `compilerOptions` in `tsconfig.json`. Ensure the `--project` (`-p`) flag is correctly pointing to your `tsconfig.json`.
Verify that `tsc-alias` is properly integrated into your build script (e.g., `"build": "tsc && tsc-alias"`). Check your `tsconfig.json`'s `compilerOptions.paths` to ensure aliases are correctly defined and match your import statements.
Add or verify `compilerOptions.paths` in your `tsconfig.json` with valid alias mappings, for example: `"paths": { "@app/*": ["src/app/*"] }`.Double-check your `tsconfig.json`'s `compilerOptions.outDir` to ensure it points to the correct compiled JavaScript output directory. If using `--inputglob`, verify the pattern matches existing files.
No dependency data recorded yet.