Skip to content

Commit

Permalink
fix: imagemin-pngquant install error (#1477)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjun1011 authored Feb 20, 2019
1 parent 8e24c68 commit fb2b771
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions tools/ice-devtools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 1 addition & 4 deletions tools/ice-devtools/lib/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions tools/ice-devtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ice-devtools",
"version": "2.1.7",
"version": "2.1.8",
"description": "ice 物料开发者工具",
"main": "bin/ice-devtools.js",
"bin": {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit fb2b771

Please sign in to comment.