我試圖在ember-cli-imagmin插件中啓用lossyPNG屬性來爲我的.png創建一個小文件大小。我在灰燼-CLI-build.js EmberApp包括imagemin像這樣:ember-cli-imagemin lossyPNG ImageMin.pngquant不是函數
imagemin: {
interlaced: true,
optimizationLevel: 3,
progressive: true,
lossyPNG: true,
pngquant: {
speed: 1,
quality: 80
}
}
的依賴於我的package.json對象包括:
{ ...
"ember-cli-imagemin": "0.4.0",
"imagemin": "3.2.2",
"imagemin-pngquant": "4.2.2",
...
}
但是,每當我跑燼構建,我得到以下錯誤:
The Broccoli Plugin: [object Object] failed with:
TypeError: ImageMin.pngquant is not a function
此錯誤指向此line in broccoli-imagemin。如果我在ember-cli-build.js中將lossyPNG設置爲false,那麼我不會收到任何錯誤,但是可以根據pagespeed的結果進一步優化我的png。我錯過了什麼能夠使用pngquant進一步優化我的PNG圖像?