# file-mapper-plugin

> The File Mapper Plugin, usually paired with the File Hasher Plugin, uses a json map file (output by File Hasher Plugin or manually generated) to find and replace file names in your project.

Latest version **1.0.1** (published 2017-09-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install file-mapper-plugin
pnpm add file-mapper-plugin
yarn add file-mapper-plugin
bun add file-mapper-plugin
```

## 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.1 |
| Published | 2017-09-13 |
| First published | 2017-09-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shawn Simon |
| Maintainers | shawn-simon-developer |

## Links

- npm: https://www.npmjs.com/package/file-mapper-plugin
- npm.io page: https://npm.io/package/file-mapper-plugin

## Dependencies (1)

- [walk](https://npm.io/package/walk.md) ^2.3.9

## Recent versions

- 1.0.1 (latest) — 2017-09-13
- 1.0.0 — 2017-09-13

## README

# File Mapper Plugin

The File Mapper Plugin, usually paired with the File Hasher Plugin, uses a json map file (output by File Hasher Plugin or manually generated) to find and replace file names in your project.

```
// fileMap.json
{
  "appdynamics.js": {
    "newFileName":"e0771a7c61cb9aa0adfdf5e8f704b386.appdynamics.js",
    "filePath":"src/app/static/appdynamics.js","newFilePath":
    ".static/e0771a7c61cb9aa0adfdf5e8f704b386.appdynamics.js"
  },
  ...
}
```

The above map allow the File Mapper Plugin to find all instances of the file `appdynamics.js` in a given file and replace it with the new name `e0771a7c61cb9aa0adfdf5e8f704b386.appdynamics.js`.

## Getting Started

To get started, add the File Hasher Plugin to your webpack config:
```
// Directory Style:
plugins: [
  ...
  new FileMapper({
    mapPath: '.static/fileMap.json',
    dirPath: 'dist',
  }),
  ...
]
```
```
// Individual Files:
plugins: [
  ...
	new FileMapper({
		mapPath: '.static/fileMap.json',
		filePath: 'dist/index.html',
		outputPath: 'dist/index.html',
	}),
  ...
]
```

### Prerequisites

Node >= 6.0.x

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