# @rnx-kit/esbuild-plugin-import-path-remapper

> Esbuild plugin for remapping 'lib/' imports to 'src/'

Latest version **3.0.1** (published 2025-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rnx-kit/esbuild-plugin-import-path-remapper
pnpm add @rnx-kit/esbuild-plugin-import-path-remapper
yarn add @rnx-kit/esbuild-plugin-import-path-remapper
bun add @rnx-kit/esbuild-plugin-import-path-remapper
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2025-12-11 |
| First published | 2021-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.17 |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1740 |
| Author | Microsoft Open Source |
| Maintainers | jasonvmorse, acoates, rnbot, tido64, rnsdkbot, hansenyy, microsoft-oss-releases, microsoft1es |

## Links

- npm: https://www.npmjs.com/package/@rnx-kit/esbuild-plugin-import-path-remapper
- Repository: https://github.com/microsoft/rnx-kit
- Homepage: https://github.com/microsoft/rnx-kit/tree/main/packages/esbuild-plugin-import-path-remapper#readme
- Issues: https://github.com/microsoft/rnx-kit/issues
- npm.io page: https://npm.io/package/@rnx-kit/esbuild-plugin-import-path-remapper

## Recent versions

- 3.0.1 (latest) — 2025-12-11
- 3.0.0 — 2024-09-11
- 2.0.0 — 2023-01-16
- 1.2.0 — 2022-03-03
- 1.1.9 — 2021-11-30
- 1.1.8 — 2021-11-18
- 1.1.7 — 2021-11-05
- 1.1.6 — 2021-11-05
- 1.1.5 — 2021-11-03
- 1.1.4 — 2021-11-01
- 1.1.3 — 2021-10-29
- 1.1.2 — 2021-10-29
- 1.1.1 — 2021-10-29
- 1.1.0 — 2021-10-11
- 1.0.0 — 2021-08-23

## README

# @rnx-kit/esbuild-plugin-import-path-remapper

[![Build](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml/badge.svg)](https://github.com/microsoft/rnx-kit/actions/workflows/build.yml)
[![npm version](https://img.shields.io/npm/v/@rnx-kit/esbuild-plugin-import-path-remapper)](https://www.npmjs.com/package/@rnx-kit/esbuild-plugin-import-path-remapper)

`@rnx-kit/esbuild-plugin-import-path-remapper` remaps `**/lib/**` imports to
`**/src/**`. This is useful for packages that are not correctly exporting
everything via their `index.ts`, but you still want to consume the TypeScript
files rather than the transpiled JavaScript.

## Usage

Add `@rnx-kit/esbuild-plugin-import-path-remapper` to your build script plugins.
The package name filter argument to the plugin is an esbuild compatible regular
expression to match the packages to transform.

For example, to remap all paths under the `@rnx-kit` scope:

```js
// esbuild.js
const ImportPathRemapperPlugin = require("@rnx-kit/esbuild-plugin-import-path-remapper");

require("esbuild")
  .build({
    entryPoints: ["app.tsx"],
    bundle: true,
    outfile: "out.js",
    plugins: [ImportPathRemapperPlugin("@rnx-kit")],
  })
  .catch(() => process.exit(1));
```

---
_Source: https://npm.io/package/@rnx-kit/esbuild-plugin-import-path-remapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
