# rollup-plugin-image-assets

> Like rollup-plugin-image, but copy image files to dest instead of inlining base64.

Latest version **1.0.0** (published 2021-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-image-assets
pnpm add rollup-plugin-image-assets
yarn add rollup-plugin-image-assets
bun add rollup-plugin-image-assets
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-09-29 |
| First published | 2021-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | DongYuwei |
| Maintainers | dongyuwei |
| Keywords | rollup-plugin, image |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-image-assets
- Repository: https://github.com/dongyuwei/rollup-plugin-images
- Homepage: https://github.com/dongyuwei/rollup-plugin-images#readme
- Issues: https://github.com/dongyuwei/rollup-plugin-images/issues
- npm.io page: https://npm.io/package/rollup-plugin-image-assets

## Dependencies (2)

- [rollup](https://npm.io/package/rollup.md) 0.64.1
- [rollup-pluginutils](https://npm.io/package/rollup-pluginutils.md) 2.4.1

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-09-29

## README

# rollup-plugin-image-assets

Forked from [rollup-plugin-image-files](https://github.com/bspaulding/rollup-plugin-image-files)

Added the following enhancements:

- supports custom output directory for images.
- copy and rename image with hash: `[name]_[md5hash].[extname]`.

## Usage

Install the plugin via npm:

```bash
npm install --save-dev rollup-plugin-image-assets
```

Add the plugin to your rollup config:

```javascript
import images from 'rollup-plugin-image-assets';

export default {
	entry: 'src/index.js',
	des: 'dist/bundle.js',
	plugins: [
		images({
			output: 'build/images'
		})
	]
};
```

Require some images in your source:

```javascript
import React from 'react';
import { Image } from 'react-native';
import imageSrc from '../path/to/image.png';

export default const MyComponent = () => (
  <img src={imageSrc} alt='' />
);
```

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