From fb2b7713e0ed4ecf97d6cb397a75e9a773acf694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E6=BE=9C?= Date: Wed, 20 Feb 2019 15:32:31 +0800 Subject: [PATCH] fix: imagemin-pngquant install error (#1477) --- tools/ice-devtools/CHANGELOG.md | 4 ++++ tools/ice-devtools/lib/screenshot.js | 5 +---- tools/ice-devtools/package.json | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/ice-devtools/CHANGELOG.md b/tools/ice-devtools/CHANGELOG.md index 0e27d32057..f742f49be4 100644 --- a/tools/ice-devtools/CHANGELOG.md +++ b/tools/ice-devtools/CHANGELOG.md @@ -1,5 +1,9 @@ # ice-scripts Changelog +## 2.1.8 + +- [fix] 修复 imagemin-pngquant 安装报错 [#46](https://github.com/imagemin/imagemin-pngquant/issues/46) + ## 2.1.7 - [chore] typescript-definition-generator 迁移为 @alifd/dts-generator [#1475](https://github.com/alibaba/ice/pull/1475) diff --git a/tools/ice-devtools/lib/screenshot.js b/tools/ice-devtools/lib/screenshot.js index 995e936c99..296b4fe9b0 100644 --- a/tools/ice-devtools/lib/screenshot.js +++ b/tools/ice-devtools/lib/screenshot.js @@ -2,7 +2,6 @@ const debug = require('debug')('ice:screenshot:general'); const path = require('path'); const imagemin = require('imagemin'); -const imageminPngquant = require('imagemin-pngquant'); const fs = require('fs'); const ora = require('ora'); const getType = require('../utils/type'); @@ -35,9 +34,7 @@ module.exports = function screenshot(cwd, opt) { await screenshotDOMElement(url, selector, screenshotTempPath); // 图片压缩 - await imagemin([screenshotTempPath], cwd, { - plugins: [imageminPngquant({ quality: '45-60' })], - }); + await imagemin([screenshotTempPath], cwd); // 删除未压缩的图像 fs.unlinkSync(screenshotTempPath); diff --git a/tools/ice-devtools/package.json b/tools/ice-devtools/package.json index bfbc698b2f..e735c21d61 100644 --- a/tools/ice-devtools/package.json +++ b/tools/ice-devtools/package.json @@ -1,6 +1,6 @@ { "name": "ice-devtools", - "version": "2.1.7", + "version": "2.1.8", "description": "ice 物料开发者工具", "main": "bin/ice-devtools.js", "bin": { @@ -53,7 +53,6 @@ "html-webpack-plugin": "^3.2.0", "ice-skin-loader": "^0.2.0", "imagemin": "^6.0.0", - "imagemin-pngquant": "^6.0.0", "inquirer": "^6.2.0", "js-yaml": "^3.12.1", "kebab-case": "^1.0.0",