# Re-map import paths (/docs/guides/runtime/tsconfig-paths)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 164 · updated: 2026-07-28 -->
Related: [Install TypeScript declarations for Bun](/docs/guides/runtime/typescript.md), [Debugging Bun with the VS Code extension](/docs/guides/runtime/vscode-debugger.md), [Debugging Bun with the web debugger](/docs/guides/runtime/web-debugger.md), [Inspect memory usage using V8 heap snapshots](/docs/guides/runtime/heap-snapshot.md), [Build-time constants with --define](/docs/guides/runtime/build-time-constants.md), [Define and replace static globals & constants](/docs/guides/runtime/define-constant.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.

```json tsconfig.json icon="file-json"
{
  "compilerOptions": {
    "paths": {
      "my-custom-name": ["./node_modules/zod"],
      "@components/*": ["./src/components/*"]
    }
  }
}
```

***

With this `tsconfig.json`, the following imports are re-written:

```ts tsconfig.ts icon="/icons/typescript.svg"
import { z } from "my-custom-name"; // imports from "zod"
import { Button } from "@components/Button"; // imports from "./src/components/Button"
```

***

See [TypeScript](/runtime/typescript).
