Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: imagemin-pngquant install error #1477

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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