# snowpack-plugin-imagemin

> Use imagemin to optimize your images in Snowpack

Latest version **1.0.0** (published 2020-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install snowpack-plugin-imagemin
pnpm add snowpack-plugin-imagemin
yarn add snowpack-plugin-imagemin
bun add snowpack-plugin-imagemin
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-08-11 |
| First published | 2020-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jared Lunde |
| Maintainers | jaredlunde |
| Keywords | snowpack plugin imagemin, snowpack plugin, imagemin |

## Links

- npm: https://www.npmjs.com/package/snowpack-plugin-imagemin
- Repository: https://github.com/jaredLunde/snowpack-plugin-imagemin
- Homepage: https://github.com/jaredLunde/snowpack-plugin-imagemin#readme
- Issues: https://github.com/jaredLunde/snowpack-plugin-imagemin/issues
- npm.io page: https://npm.io/package/snowpack-plugin-imagemin

## Dependencies (2)

- [imagemin](https://npm.io/package/imagemin.md) ^7.0.1
- [@types/imagemin](https://npm.io/package/@types/imagemin.md) ^7.0.0

## 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) — 2020-08-11

## README

<hr/>

# snowpack-plugin-imagemin

> Use [imagemin](https://github.com/imagemin/imagemin) to optimize your images in [Snowpack](https://snowpack.dev). This plugin will only compress
> images in "production" after your build finishes.

```sh
npm i snowpack-plugin-imagemin
```

<p>
  <!--
  <a aria-label="Code coverage report" href="https://codecov.io/gh/jaredLunde/snowpack-plugin-imagemin">
    <img alt="Code coverage" src="https://img.shields.io/codecov/c/gh/jaredLunde/snowpack-plugin-imagemin?style=for-the-badge&labelColor=24292e">
  </a>
  -->
  <a aria-label="Build status" href="https://travis-ci.com/jaredLunde/snowpack-plugin-imagemin">
    <img alt="Build status" src="https://img.shields.io/travis/com/jaredLunde/snowpack-plugin-imagemin?style=for-the-badge&labelColor=24292e">
  </a>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/snowpack-plugin-imagemin">
    <img alt="NPM Version" src="https://img.shields.io/npm/v/snowpack-plugin-imagemin?style=for-the-badge&labelColor=24292e">
  </a>
  <a aria-label="License" href="https://jaredlunde.mit-license.org/">
    <img alt="MIT License" src="https://img.shields.io/npm/l/snowpack-plugin-imagemin?style=for-the-badge&labelColor=24292e">
  </a>
</p>

---

## Quick start

```js
// snowpack.config.js
module.exports = {
  plugins: [
    [
      'snowpack-plugin-imagemin',
      {
        /* see "Plugin Options" below */
        include: ['**/*.jpg', '**/*.png'],
        plugins: [
          require('imagemin-mozjpeg')({quality: 90, progressive: true}),
          require('imagemin-optipng')({optimizationLevel: 7}),
        ],
      },
    ],
  ],
}
```

#### Plugin Options

```typescript
export interface SnowpackPluginImageminOptions {
  /**
   * Includes only the specified globs. Globs should be relative
   * to the build directory, which is `build/` by default in Snowpack.
   * *
   * ! This option is required !
   */
  include: Parameters<typeof imagemin>[0]
  /**
   * Plugins to use.
   * @see https://www.npmjs.com/search?q=keywords:imageminplugin
   *
   * ! This option is required !
   */
  plugins: imagemin.Options['plugins']
}
```

## LICENSE

MIT

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