# parcel-namer-struct

> Custom dest file struct by type and regexp. Inspired by .

Latest version **1.0.0** (published 2022-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install parcel-namer-struct
pnpm add parcel-namer-struct
yarn add parcel-namer-struct
bun add parcel-namer-struct
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-01-06 |
| First published | 2022-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 1 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | anjianshi |

## Links

- npm: https://www.npmjs.com/package/parcel-namer-struct
- Repository: https://github.com/anjianshi/parcel-namer-struct
- npm.io page: https://npm.io/package/parcel-namer-struct

## Dependencies (1)

- [@parcel/plugin](https://npm.io/package/@parcel/plugin.md) ^2.0.0

## Recent versions

- 1.0.0 (latest) — 2022-01-06

## README

# parcel-namer-struct

Custom dest file struct by type and regexp.  
Inspired by <https://github.com/vseventer/parcel-namer-custom>.

## Installation

```shell
npm i -D parcel-namer-struct
```

or use `yarn`

```shell
yarn add --dev parcel-namer-struct
```


## Configuration

Add a `.parcelrc` into your project root directory (next to package.json):

```json
{
  "extends": "@parcel/config-default",
  "namers": [
    "parcel-namer-struct",
    "..."
  ]
}
```

Then set `parcel-namer-struct` field in `package.json`
```json
// package.json
{
  "parcel-namer-struct": [
    {
      type: 'match-bundle-type',         // Optional. Can be `'string'` or `['type', 'type2']`
      match: '^match-source-path$',      // Optional. Match source path (not dist path).
      dest: 'placement-dir',
    },
    {
      match: '/index/index.html',
      dest: '/',
    },
    {
      type: ['png', 'jpg'],
      dest: '/images/',
    }
  ]
}

// /src/index/index.html -> /index.html
// /src/assets/test.png -> /images/test.png
```

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