[Runtime
](../../../index.md)[Package Manager
](../../../pm/cli/install/index.md)[Bundler
](../../../bundler/index.md)[Test Runner
](../../../test/index.md)[Guides
](../../index.md)[Reference
](https://bun.com/reference)[Blog
](https://bun.com/blog)[Feedback
](../../../feedback/index.md)
Bun reads the paths field in your tsconfig.json to re-write import paths. This is useful for aliasing package names or avoiding long relative paths.
tsconfig.json
{
"compilerOptions": {
"paths": {
"my-custom-name": ["zod"],
"@components/*": ["./src/components/*"]
}
}
}
With the above tsconfig.json, the following imports will be re-written:
tsconfig.ts
import { z } from "my-custom-name"; // imports from "zod"
import { Button } from "@components/Button"; // imports from "./src/components/Button"
See Docs > Runtime > TypeScript for more information on using TypeScript with Bun.
Was this page helpful?
[
Install TypeScript declarations for Bun
Previous
](../typescript/index.md)[
Debugging Bun with the VS Code extension
Next
](../vscode-debugger/index.md)