Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.71 KB

README.md

File metadata and controls

52 lines (37 loc) · 1.71 KB

@assetpack/plugin-compress

AssetPack plugin for compressing images using sharp.

Installation

npm install --save-dev @assetpack/plugin-compress

Usage

import { compressJpg, compressPng, compressWebp, compressAvif } from "@assetpack/plugin-compress";

export default {
  ...
  plugins: {
    ...
    compressJpg: compressJpg(),
    compressPng: compressPng(),
    compressWebp: compressWebp(),
    compressAvif: compressAvif(),
  },
};

Options

compressJpg

  • compression: Any settings supported by sharp
  • tags - An object containing the tags to use for the plugin. Defaults to { nc: "nc" }.
    • nc - The tag used to denote that the image should not be compressed. Can be placed on a folder or file.

compressPng

  • compression: Any settings supported by sharp
  • tags - An object containing the tags to use for the plugin. Defaults to { nc: "nc" }.
    • nc - The tag used to denote that the image should not be compressed. Can be placed on a folder or file.

compressWebp

  • compression: Any settings supported by sharp
  • tags - An object containing the tags to use for the plugin. Defaults to { nc: "nc" }.
    • nc - The tag used to denote that the image should not be compressed. Can be placed on a folder or file.

compressAvif

  • compression: Any settings supported by sharp
  • tags - An object containing the tags to use for the plugin. Defaults to { nc: "nc" }.
    • nc - The tag used to denote that the image should not be compressed. Can be placed on a folder or file.