# rollup-plugin-tinyimg

> [![Build Status](https://github.com/HZZformGD/rollup-plugin-tinyimg?branch=master)](https://github.com/HZZformGD/rollup-plugin-tinyimg)

Latest version **1.0.7** (published 2022-05-31) · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-tinyimg
pnpm add rollup-plugin-tinyimg
yarn add rollup-plugin-tinyimg
bun add rollup-plugin-tinyimg
```

## 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.7 |
| Published | 2022-05-31 |
| First published | 2022-05-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 578.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | zhenzhanhuang |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-tinyimg
- Repository: https://github.com/HZZformGD/rollup-plugin-tinyimg
- Homepage: https://github.com/HZZformGD/rollup-plugin-tinyimg/blob/master/README.md
- Issues: https://github.com/HZZformGD/rollup-plugin-tinyimg/issues
- npm.io page: https://npm.io/package/rollup-plugin-tinyimg

## Dependencies (6)

- [ora](https://npm.io/package/ora.md) 5.4.1
- [jest](https://npm.io/package/jest.md) ^28.1.0
- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [rollup](https://npm.io/package/rollup.md) ^2.73.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.1.0
- [random-useragent](https://npm.io/package/random-useragent.md) ^0.5.0

## Recent versions

- 1.0.7 (latest) — 2022-05-31
- 1.0.6 — 2022-05-17
- 1.0.5 — 2022-05-16
- 1.0.4 — 2022-05-16
- 1.0.3 — 2022-05-16
- 1.0.2 — 2022-05-16
- 1.0.1 — 2022-05-16
- 1.0.0 — 2022-05-16

## README

# rollup-plugin-tinyimg

[![Build Status](https://github.com/HZZformGD/rollup-plugin-tinyimg?branch=master)](https://github.com/HZZformGD/rollup-plugin-tinyimg)

Using tinypng or tinyjpg to compress your images

<p align="center">
  🇨🇳 <a href="./README.zh-CN.md">中文版介绍</a>
</p>

## Installation

```bash
# yarn
yarn add rollup-plugin-tinyimg -D

# npm
npm install rollup-plugin-tinyimg -D
```

## Usage

```js
// rollup.config.js
import tinyimg from "rollup-plugin-tinyimg";

export default {
  input: "src/index.js",
  output: {
    file: "dist/app.js",
    format: "cjs",
  },
  plugins: [
    tinyimg({
      input: resolve(__dirname, "public"),
      output: resolve(__dirname, "dist"),
    }),
  ],
};
```

### Configuration

There are some useful options:

#### input

Type: `String`

it's input dir name :

```js
tinyimg({
  input: resolve(__dirname, "public"),
});
```

#### output

Type: `String`

it's output dir name :

```js
tinyimg({
  output: resolve(__dirname, "dist"),
});
```

#### imageRegx

Type: `Regx`| default `/\.(jpe?g|png|webp)$/`

Match the suffix of the image to be compressed

```js
tinyimg({
    ...,
  imageRegx: /\.(jpe?g|png|webp)$/,
});
```

## License
MIT

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