Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
vben-admin committed Apr 3, 2021
1 parent 522d49f commit 67ec83d
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 222 deletions.
12 changes: 6 additions & 6 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"build": "vite build "
},
"dependencies": {
"vue": "^3.0.7"
"vue": "^3.0.11"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.1.5",
"@vitejs/plugin-vue-jsx": "^1.1.2",
"@vue/compiler-sfc": "^3.0.7",
"@vitejs/plugin-vue": "^1.2.1",
"@vitejs/plugin-vue-jsx": "^1.1.3",
"@vue/compiler-sfc": "^3.0.11",
"cross-env": "^7.0.3",
"typescript": "^4.2.2",
"vite": "^2.0.4"
"typescript": "^4.2.3",
"vite": "^2.1.5"
}
}
172 changes: 93 additions & 79 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79"
integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==

"@babel/parser@^7.13.9":
version "7.13.13"
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df"
integrity sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==

"@babel/plugin-syntax-import-meta@^7.10.4":
version "7.10.4"
resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51"
Expand Down Expand Up @@ -241,21 +246,30 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"

"@vitejs/plugin-vue-jsx@^1.1.2":
version "1.1.2"
resolved "https://registry.npmjs.org/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-1.1.2.tgz#d240d8d73c2f8e34f32ade6d06e709a959d1f2a1"
integrity sha512-3m+0amZwkn0g/D3OqqTsG2qe82LvIaQYqAi3Klpx2vEdaBU5pgok5Qlp6eMGr6QQRDLa7HAKZbPCVV5yAPfOpg==
"@babel/types@^7.13.0":
version "7.13.14"
resolved "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d"
integrity sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==
dependencies:
"@babel/helper-validator-identifier" "^7.12.11"
lodash "^4.17.19"
to-fast-properties "^2.0.0"

"@vitejs/plugin-vue-jsx@^1.1.3":
version "1.1.3"
resolved "https://registry.npmjs.org/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-1.1.3.tgz#426c68f8a367a603acb82fca6e2b12506ba9fc8e"
integrity sha512-R9wsuNDEKTDG5oXJaFictrw9E5uokniGzi6tvyO5Od02tE4TnOPfgY2BeHKB4f4ldgiZRMhdUhNEsgjoWnct6A==
dependencies:
"@babel/core" "^7.12.10"
"@babel/plugin-syntax-import-meta" "^7.10.4"
"@babel/plugin-transform-typescript" "^7.12.1"
"@vue/babel-plugin-jsx" "^1.0.3"
hash-sum "^2.0.0"

"@vitejs/plugin-vue@^1.1.5":
version "1.1.5"
resolved "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.1.5.tgz#fa1e8e5e049c35e213672e33f73fe81706ad5dbe"
integrity sha512-4DV8VPYo8/OR1YsnK39QN16xhKENt2XvcmJxqfRtyz75kvbjBYh1zTSHLp7XsXqv4R2I+fOZlbEBvxosMYLcPA==
"@vitejs/plugin-vue@^1.2.1":
version "1.2.1"
resolved "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.2.1.tgz#6de49436fc346f829a56676066428e3f011522ac"
integrity sha512-TG+LbEUNwfFrx1VyN+iq+PsiGd9MT16hUdJY+BnMXj3MrLAF8m3VYUspTDM3aXoh48YDmAkMjG4gWFRg3lbG5A==

"@vue/babel-helper-vue-transform-on@^1.0.2":
version "1.0.2"
Expand All @@ -277,36 +291,36 @@
html-tags "^3.1.0"
svg-tags "^1.0.0"

"@vue/[email protected].7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.7.tgz#421782a4c67cc3f2b7c30457ef446d74f8524f74"
integrity sha512-JFohgBXoyUc3mdeI2WxlhjQZ5fakfemJkZHX8Gu/nFbEg3+lKVUZmNKWmmnp9aOzJQZKoj77LjmFxiP+P+7lMQ==
"@vue/[email protected].11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.11.tgz#5ef579e46d7b336b8735228758d1c2c505aae69a"
integrity sha512-6sFj6TBac1y2cWCvYCA8YzHJEbsVkX7zdRs/3yK/n1ilvRqcn983XvpBbnN3v4mZ1UiQycTvOiajJmOgN9EVgw==
dependencies:
"@babel/parser" "^7.12.0"
"@babel/types" "^7.12.0"
"@vue/shared" "3.0.7"
"@vue/shared" "3.0.11"
estree-walker "^2.0.1"
source-map "^0.6.1"

"@vue/[email protected].7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.7.tgz#54d2e12fb9a7aff53abd19dac2c2679533f0c919"
integrity sha512-VnIH9EbWQm/Tkcp+8dCaNVsVvhm/vxCrIKWRkXY9215hTqOqQOvejT8IMjd2kc++nIsYMsdQk6H9qqBvoLe/Cw==
dependencies:
"@vue/compiler-core" "3.0.7"
"@vue/shared" "3.0.7"

"@vue/compiler-sfc@^3.0.7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.0.7.tgz#900414750cc726553b870490f48073451fd14f07"
integrity sha512-37/QILpGE+J3V+bP9Slg9e6xGqfk+MmS2Yj8ChR4fS0/qWUU/YoYHE0GPIzjmBdH0JVOOmJqunxowIXmqNiHng==
dependencies:
"@babel/parser" "^7.12.0"
"@babel/types" "^7.12.0"
"@vue/compiler-core" "3.0.7"
"@vue/compiler-dom" "3.0.7"
"@vue/compiler-ssr" "3.0.7"
"@vue/shared" "3.0.7"
"@vue/[email protected].11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.11.tgz#b15fc1c909371fd671746020ba55b5dab4a730ee"
integrity sha512-+3xB50uGeY5Fv9eMKVJs2WSRULfgwaTJsy23OIltKgMrynnIj8hTYY2UL97HCoz78aDw1VDXdrBQ4qepWjnQcw==
dependencies:
"@vue/compiler-core" "3.0.11"
"@vue/shared" "3.0.11"

"@vue/compiler-sfc@^3.0.11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.0.11.tgz#cd8ca2154b88967b521f5ad3b10f5f8b6b665679"
integrity sha512-7fNiZuCecRleiyVGUWNa6pn8fB2fnuJU+3AGjbjl7r1P5wBivfl02H4pG+2aJP5gh2u+0wXov1W38tfWOphsXw==
dependencies:
"@babel/parser" "^7.13.9"
"@babel/types" "^7.13.0"
"@vue/compiler-core" "3.0.11"
"@vue/compiler-dom" "3.0.11"
"@vue/compiler-ssr" "3.0.11"
"@vue/shared" "3.0.11"
consolidate "^0.16.0"
estree-walker "^2.0.1"
hash-sum "^2.0.0"
Expand All @@ -318,42 +332,42 @@
postcss-selector-parser "^6.0.4"
source-map "^0.6.1"

"@vue/[email protected].7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.0.7.tgz#28b85d497381d75fe44234057b140b0065ca9dbf"
integrity sha512-nHRbHeSpfXwjypettjrA16TjgfDcPEwq3m/zHnGyLC1QqdLtklXmpSM43/CPwwTCRa/qdt0pldJf22MiCEuTSQ==
"@vue/[email protected].11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.0.11.tgz#ac5a05fd1257412fa66079c823d8203b6a889a13"
integrity sha512-66yUGI8SGOpNvOcrQybRIhl2M03PJ+OrDPm78i7tvVln86MHTKhM3ERbALK26F7tXl0RkjX4sZpucCpiKs3MnA==
dependencies:
"@vue/compiler-dom" "3.0.7"
"@vue/shared" "3.0.7"
"@vue/compiler-dom" "3.0.11"
"@vue/shared" "3.0.11"

"@vue/[email protected].7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.7.tgz#e6ccc7bef7fc10b0972e4d974bad71679d3b26ad"
integrity sha512-FotWcNNaKhqpFZrdgsUOZ1enlJ5lhTt01CNTtLSyK7jYFgZBTuw8vKsEutZKDYZ1XKotOfoeO8N3pZQqmM6Etw==
"@vue/[email protected].11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.11.tgz#07b588349fd05626b17f3500cbef7d4bdb4dbd0b"
integrity sha512-SKM3YKxtXHBPMf7yufXeBhCZ4XZDKP9/iXeQSC8bBO3ivBuzAi4aZi0bNoeE2IF2iGfP/AHEt1OU4ARj4ao/Xw==
dependencies:
"@vue/shared" "3.0.7"
"@vue/shared" "3.0.11"

"@vue/[email protected].7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.7.tgz#d44c0b0a57d7e392912a87362a4430ccf446ecea"
integrity sha512-DBAZAwVvdmMXuyd6/9qqj/kYr/GaLTmn1L2/QLxLwP+UfhIboiTSBc/tUUb8MRk7Bb98GzNeAWkkT6AfooS3dQ==
"@vue/[email protected].11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.11.tgz#c52dfc6acf3215493623552c1c2919080c562e44"
integrity sha512-87XPNwHfz9JkmOlayBeCCfMh9PT2NBnv795DSbi//C/RaAnc/bGZgECjmkD7oXJ526BZbgk9QZBPdFT8KMxkAg==
dependencies:
"@vue/reactivity" "3.0.7"
"@vue/shared" "3.0.7"
"@vue/reactivity" "3.0.11"
"@vue/shared" "3.0.11"

"@vue/[email protected].7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.7.tgz#b70668d729020bc4ad608c20367223f259576ba6"
integrity sha512-Oij4ruOtnpQpCj+/Q3JPzgpTJ1Q7+N67pA53A8KVITEtxfvKL46NN6dhAZ5NGqwX6RWZpYqWQNewITeF0pHr8g==
"@vue/[email protected].11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.11.tgz#7a552df21907942721feb6961c418e222a699337"
integrity sha512-jm3FVQESY3y2hKZ2wlkcmFDDyqaPyU3p1IdAX92zTNeCH7I8zZ37PtlE1b9NlCtzV53WjB4TZAYh9yDCMIEumA==
dependencies:
"@vue/runtime-core" "3.0.7"
"@vue/shared" "3.0.7"
"@vue/runtime-core" "3.0.11"
"@vue/shared" "3.0.11"
csstype "^2.6.8"

"@vue/[email protected].7":
version "3.0.7"
resolved "https://registry.npmjs.org/@vue/shared/-/shared-3.0.7.tgz#96d52988efc07444c108c7c6803ba7cc93e40045"
integrity sha512-dn5FyfSc4ky424jH4FntiHno7Ss5yLkqKNmM/NXwANRnlkmqu74pnGetexDFVG5phMk9/FhwovUZCWGxsotVKg==
"@vue/[email protected].11":
version "3.0.11"
resolved "https://registry.npmjs.org/@vue/shared/-/shared-3.0.11.tgz#20d22dd0da7d358bb21c17f9bde8628152642c77"
integrity sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA==

ansi-styles@^3.2.1:
version "3.2.1"
Expand Down Expand Up @@ -455,10 +469,10 @@ emojis-list@^3.0.0:
resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==

esbuild@^0.8.52:
version "0.8.54"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.54.tgz#2f32ff80e95c69a0f25b799d76a27c05e2857cdf"
integrity sha512-DJH38OiTgXJxFb/EhHrCrY8eGmtdkTtWymHpN9IYN9AF+4jykT0dQArr7wzFejpVbaB0TMIq2+vfNRWr3LXpvw==
esbuild@^0.9.3:
version "0.9.7"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.9.7.tgz#ea0d639cbe4b88ec25fbed4d6ff00c8d788ef70b"
integrity sha512-VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg==

escape-string-regexp@^1.0.5:
version "1.0.5"
Expand Down Expand Up @@ -784,10 +798,10 @@ to-fast-properties@^2.0.0:
resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=

typescript@^4.2.2:
version "4.2.2"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.2.tgz#1450f020618f872db0ea17317d16d8da8ddb8c4c"
integrity sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ==
typescript@^4.2.3:
version "4.2.3"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3"
integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==

uniq@^1.0.1:
version "1.0.1"
Expand All @@ -799,26 +813,26 @@ util-deprecate@^1.0.2:
resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=

vite@^2.0.4:
version "2.0.4"
resolved "https://registry.npmjs.org/vite/-/vite-2.0.4.tgz#063532a4139b59a067297d8ebb5960d450907a09"
integrity sha512-+PP89D7AKXFE4gps8c5+4eP5yXTh5qCogjdYX7iSsIxbLZAa26JoGSq6OLk0qdb/fqDh7gtJqGiLbG2V6NvkKQ==
vite@^2.1.5:
version "2.1.5"
resolved "https://registry.npmjs.org/vite/-/vite-2.1.5.tgz#4857da441c62f7982c83cbd5f42a00330f20c9c1"
integrity sha512-tYU5iaYeUgQYvK/CNNz3tiJ8vYqPWfCE9IQ7K0iuzYovWw7lzty7KRYGWwV3CQPh0NKxWjOczAqiJsCL0Xb+Og==
dependencies:
esbuild "^0.8.52"
esbuild "^0.9.3"
postcss "^8.2.1"
resolve "^1.19.0"
rollup "^2.38.5"
optionalDependencies:
fsevents "~2.3.1"

vue@^3.0.7:
version "3.0.7"
resolved "https://registry.npmjs.org/vue/-/vue-3.0.7.tgz#8bcff51f8be570f9e4ce8cc5f52e2ab0fe3c74a1"
integrity sha512-8h4TikD+JabbMK9aRlBO4laG0AtNHRPHynxYgWZ9sq1YUPfzynd9Jeeb27XNyZytC7aCQRX9xe1+TQJuc181Tw==
vue@^3.0.11:
version "3.0.11"
resolved "https://registry.npmjs.org/vue/-/vue-3.0.11.tgz#c82f9594cbf4dcc869241d4c8dd3e08d9a8f4b5f"
integrity sha512-3/eUi4InQz8MPzruHYSTQPxtM3LdZ1/S/BvaU021zBnZi0laRUyH6pfuE4wtUeLvI8wmUNwj5wrZFvbHUXL9dw==
dependencies:
"@vue/compiler-dom" "3.0.7"
"@vue/runtime-dom" "3.0.7"
"@vue/shared" "3.0.7"
"@vue/compiler-dom" "3.0.11"
"@vue/runtime-dom" "3.0.11"
"@vue/shared" "3.0.11"

which@^2.0.1:
version "2.0.2"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/imagemin-mozjpeg": "^8.0.0",
"@types/imagemin-optipng": "^5.2.0",
"@types/imagemin-pngquant": "^8.0.0",
"@types/imagemin-svgo": "^8.0.0",
"@types/imagemin-svgo": "^8.0.1",
"@types/imagemin-webp": "^5.1.1",
"chalk": "^4.1.0",
"debug": "^4.3.2",
Expand All @@ -47,7 +47,7 @@
"imagemin-gifsicle": "^7.0.0",
"imagemin-mozjpeg": "^9.0.0",
"imagemin-optipng": "^8.0.0",
"imagemin-pngquant": "^9.0.1",
"imagemin-pngquant": "^9.0.2",
"imagemin-svgo": "^8.0.0",
"imagemin-webp": "^6.0.0"
},
Expand All @@ -62,14 +62,14 @@
"@types/chalk": "^2.2.0",
"@types/debug": "^4.1.5",
"@types/es-module-lexer": "^0.3.0",
"@types/fs-extra": "^9.0.8",
"@types/node": "^14.14.31",
"@types/fs-extra": "^9.0.10",
"@types/node": "^14.14.37",
"conventional-changelog-cli": "^2.1.1",
"ini": "^2.0.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"tsup": "^4.6.0",
"typescript": "^4.2.2",
"vite": "^2.0.4"
"tsup": "^4.8.21",
"typescript": "^4.2.3",
"vite": "^2.1.5"
}
}
10 changes: 8 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ export default (options: VitePluginImageMin = {}): Plugin => {
let files = readAllFile(outputPath) || [];
debug('files:', files);

if (!files.length) return;
if (!files.length) {
return;
}

files = filterFiles(files, filter);

const tinyMap = new Map<string, { size: number; oldSize: number; ratio: number }>();

const handles = files.map(async (filePath: string) => {
let { mtimeMs, size: oldSize } = await fs.stat(filePath);
if (mtimeMs <= (mtimeCache.get(filePath) || 0)) return;
if (mtimeMs <= (mtimeCache.get(filePath) || 0)) {
return;
}

let content = await fs.readFile(filePath);
try {
Expand Down Expand Up @@ -159,6 +163,7 @@ function getImageminPlugins(options: VitePluginImageMin = {}): imagemin.Plugin[]
} = options;

const plugins: imagemin.Plugin[] = [];

if (isNotFalse(gifsicle)) {
debug('gifsicle:', true);
const opt = isBoolean(gifsicle) ? undefined : gifsicle;
Expand Down Expand Up @@ -188,6 +193,7 @@ function getImageminPlugins(options: VitePluginImageMin = {}): imagemin.Plugin[]
const opt = isBoolean(svgo) ? undefined : svgo;
plugins.push(imageminSvgo(opt));
}

if (isNotFalse(webp)) {
debug('webp:', true);
const opt = isBoolean(webp) ? undefined : webp;
Expand Down
Loading

0 comments on commit 67ec83d

Please sign in to comment.