Smart image optimization
In today’s media rich world websites tend to have a great deal of imagery. But it’s easy to forgot about the user with slow internet connections that have to download these images!
Image-Optimizer aims to solve this problem by:
yarn add image-optimizer
const imageOptimizer = require('image-optimizer');
imageOptimizer({
root: 'src/style/img', // The root directory for your images.
blacklist: [] // The list of directories/files not to optimize.
}, (err, result) => {...});
Once the optmization has taken place a __image-digest.json
will be placed in the root
directory.
At the moment the following image formats are supported: