# @gatsbyjs/parcel-namer-relative-to-cwd

> Parcel namer that preserves directory structures to stabilize output and keep the hierarchy.

Latest version **2.16.0** (published 2026-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gatsbyjs/parcel-namer-relative-to-cwd
pnpm add @gatsbyjs/parcel-namer-relative-to-cwd
yarn add @gatsbyjs/parcel-namer-relative-to-cwd
bun add @gatsbyjs/parcel-namer-relative-to-cwd
```

## Health

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

Positive: no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.16.0 |
| Published | 2026-01-26 |
| First published | 2022-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18.0.0 <26 |
| Dependencies | 4 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 55943 |
| Author | Michal Piechowiak |
| Maintainers | pieh, mlgualtieri-gatsby, gatsby_integrations, kathmbeck, seanroberts, serhalp-netlify |

## Links

- npm: https://www.npmjs.com/package/@gatsbyjs/parcel-namer-relative-to-cwd
- Repository: https://github.com/gatsbyjs/gatsby
- Homepage: https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-parcel-namer-relative-to-cwd#readme
- Issues: https://github.com/gatsbyjs/gatsby/issues
- npm.io page: https://npm.io/package/@gatsbyjs/parcel-namer-relative-to-cwd

## Dependencies (4)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.20.13
- [@parcel/plugin](https://npm.io/package/@parcel/plugin.md) 2.8.3
- [gatsby-core-utils](https://npm.io/package/gatsby-core-utils.md) ^4.16.0
- [@parcel/namer-default](https://npm.io/package/@parcel/namer-default.md) 2.8.3

## Recent versions

- 2.16.0 (latest) — 2026-01-26
- 2.17.0-next.0 (next) — 2025-11-27
- 1.10.0 (latest-v4) — 2022-12-07
- 2.0.0-alpha-drupal-proxyurl.14 (drupal-proxyurl) — 2022-11-22
- 2.0.0-alpha-transformer-json.20740 (alpha-transformer-json) — 2022-10-12
- 2.0.0-alpha-v5.d20221012t101120.57 (alpha-v5) — 2022-10-12
- 1.8.0-alpha-preview-gh-api.26 (preview-gh-api) — 2022-09-08
- 1.8.0-alpha-9689ff.25 (alpha-9689ff) — 2022-08-31
- 1.5.0-mdxv4-rc.124 (mdxv4-rc) — 2022-07-27
- 1.3.0-alpha-drupal-self-reference.18 (drupal-self-reference) — 2022-07-19
- 1.3.0-alpha-mdx-v2.68 (alpha-mdx-v2) — 2022-06-30
- 1.1.0-alpha-wp-image-cdn-auth.20253 (wp-image-cdn-auth) — 2022-05-20
- 2.15.0 — 2025-08-27
- 2.16.0-next.0 — 2025-08-27
- 2.15.0-next.0 — 2024-11-07
- … 92 more at https://npm.io/package/@gatsbyjs/parcel-namer-relative-to-cwd/versions

## README

# `@gatsbyjs/parcel-namer-relative-to-cwd`

This [namer plugin](https://parceljs.org/plugin-system/namer/) is used by [Gatsby](https://www.gatsbyjs.com/) internally. You can reuse it inside your app if you want.

If you're just using Gatsby, you don't need to care about this package/plugin.

## Usage

```shell
npm install --save-dev @gatsbyjs/parcel-namer-relative-to-cwd
```

And inside your `.parcelrc`:

```
{
  "extends": "@parcel/config-default",
  "namers": ["@gatsbyjs/parcel-namer-relative-to-cwd", "..."]
}
```

## Why & How

By default, Parcel is trying to find common/shared directories between entries and output paths that are impacted by it. See [this issue comment](https://github.com/parcel-bundler/parcel/issues/5476#issuecomment-769058504) for more information.

With these inputs files:

```
a.html
sub/b.html
```

You get:

- `parcel build a.html` => `dist/a.html`
- `parcel build sub/b.html` => `dist/b.html`
- `parcel build a.html sub/b.html` => `dist/a.html`, `dist/sub/b.html`

You can see that `sub/b.html` entry might result in either `dist/b.html` or `dist/sub/b.html` (depending wether `a.html` is entry or not). This makes builds not deterministic, which is very problematic where entries are "optional".

This namer plugin stabilizes the output, so inside `distDir` the hierarchy is the same as entry file in relation to current working directory (CWD):

- `parcel build a.html` => `dist/a.html`
- `parcel build sub/b.html` => `dist/sub/b.html`
- `parcel build a.html sub/b.html` => `dist/a.html`, `dist/sub/b.html`

---
_Source: https://npm.io/package/@gatsbyjs/parcel-namer-relative-to-cwd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
