Skip to content

Commit

Permalink
fix(imagemin): use preset-default plugin instead (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Aug 18, 2021
1 parent edd05be commit 3935ca5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-panthers-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pkgr/imagemin": patch
---

fix: use preset-default plugin instead
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"@types/react": "^17.0.18",
"@types/react-dom": "^17.0.9",
"@types/resolve": "^1.20.1",
"@types/svgo": "^2.3.1",
"@types/webpack-dev-server": "^3.11.5",
"@types/webpack-env": "^1.16.2",
"@types/workbox-webpack-plugin": "^5.1.8",
Expand Down
1 change: 0 additions & 1 deletion packages/imagemin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"imagemin-upng": "^3.0.0",
"imagemin-webp": "^6.0.0",
"is-glob": "^4.0.1",
"svgo": "^2.4.0",
"tiny-glob": "^0.2.9",
"tslib": "^2.3.1"
},
Expand Down
13 changes: 8 additions & 5 deletions packages/imagemin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from 'fs'

import { Plugin } from 'imagemin'
import { extendDefaultPlugins } from 'svgo'

const plugins = (
[
Expand Down Expand Up @@ -35,12 +34,16 @@ const plugins = (
[
'svgo',
{
plugins: extendDefaultPlugins([
plugins: [
{
name: 'removeViewBox',
active: false,
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
]),
],
},
],
['webp'],
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3089,11 +3089,6 @@
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c"
integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==

"@types/svgo@^2.3.1":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@types/svgo/-/svgo-2.3.1.tgz#85442587bc72bbfb92f3721020e28d678b8744ec"
integrity sha512-L7gdQLO8cfGKksOVtlpS0jwh04SL3W7xe+efuWbNnfSwl3cKSdgX0gLl5VnHDtSAX//xfCbEgB+RSN64tfShqQ==

"@types/tapable@^1":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310"
Expand Down Expand Up @@ -14288,7 +14283,7 @@ svgo@^1.2.2, svgo@^1.3.2:
unquote "~1.1.1"
util.promisify "~1.0.0"

svgo@^2.1.0, svgo@^2.3.0, svgo@^2.4.0:
svgo@^2.1.0, svgo@^2.3.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.4.0.tgz#0c42653101fd668692c0f69b55b8d7b182ef422b"
integrity sha512-W25S1UUm9Lm9VnE0TvCzL7aso/NCzDEaXLaElCUO/KaVitw0+IBicSVfM1L1c0YHK5TOFh73yQ2naCpVHEQ/OQ==
Expand Down

0 comments on commit 3935ca5

Please sign in to comment.