0.2.7 • Published 1 year ago

@factorial/stack-images v0.2.7

Weekly downloads
25
License
MIT
Repository
github
Last release
1 year ago

@factorial/stack-images

This is the Image plugin for @factorial/stack-core. It uses @squoosh/lib under the hood.

It adds three tasks:

  • optimize, which optimizes jpg, jpeg and png files
  • webp, which converts jpg, jpeg and png files to webp files
  • avif, which converts jpg, jpeg and png files to avif files

NOTE: These tasks overwrite existing files!

Installation

You can install it via:

yarn factorial init

or manually via:

yarn add @factorial/stack-images

Make sure it is added to your .factorialrc.js like this:

// .factorialrc.js

module.exports = {
  use: [require("@factorial/stack-images")],
};

Usage

In your .factorialrc.js add a imageFolders key with an array of folders that contain your image files:

// .factorialrc.js

module.exports = {
  imageFolders: ["images"], // relative to your rootFolder
};

Then run

yarn factorial optimize // to optimize jpg and png files

or

yarn factorial webp // to create webp files

or

yarn factorial avif // to create avif files
0.2.7

1 year ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago