1.0.7 β€’ Published 2 years ago

rollup-plugin-tinyimg v1.0.7

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

rollup-plugin-tinyimg

Build Status

Using tinypng or tinyjpg to compress your images

Installation

# yarn
yarn add rollup-plugin-tinyimg -D

# npm
npm install rollup-plugin-tinyimg -D

Usage

// 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 :

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

output

Type: String

it's output dir name :

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

imageRegx

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

Match the suffix of the image to be compressed

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

License

MIT

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago