vendredi 26 mai 2017

ember-cli-imagemin lossyPNG ImageMin.pngquant is not a function

I'm trying to enable the lossyPNG property in the ember-cli-imagmin addon to create a small file size for my .pngs. My EmberApp in ember-cli-build.js includes imagemin like so:

imagemin: {
  interlaced: true,
  optimizationLevel: 3,
  progressive: true,
  lossyPNG: true,
  pngquant: {
    speed: 1,
    quality: 80
  }
}

The dependencies object in my package.json includes:

{ ...
  "ember-cli-imagemin": "0.4.0",
  "imagemin": "3.2.2",
  "imagemin-pngquant": "4.2.2",
  ...
}

However, whenever I run ember build I get the following error:

The Broccoli Plugin: [object Object] failed with:
TypeError: ImageMin.pngquant is not a function

This error points me to this line in broccoli-imagemin. If I set lossyPNG to false in ember-cli-build.js then I receive no error, but my pngs could be optimized further based on the results from pagespeed. What am I missing to be able to use pngquant to further optimize my png images?




Aucun commentaire:

Enregistrer un commentaire