@assetpack/plugin-compress
v0.8.0
Published
AssetPack plugin for compressing images using sharp.
Downloads
1,965
Readme
@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.