This module is a crafty preset to compress images if they're jpg, png, gif or svg


npm install @swissquote/crafty-preset-images --save-dev
module.exports = {
  presets: [

Behind a corporate proxy

If you are behind a corporate proxy, or your build machine doesn't have internet access, this preset's dependencies will fail.

The problem

jpg/png/gif compression tools are not bundled with their NPM packages, but downloaded from GitHub directly.

Open issues about that

  • (no open issue, same issue as optipng-bin)

The alternative

You can use crafty-preset-images-simple instead that will provide the same feature for SVG, but will copy other images over to the destination directory.