Skip to content

Commit

Permalink
chore: update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vben-admin committed Mar 1, 2021
1 parent d5ba9e5 commit d37e87d
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 203 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Since [vite-plugin-compress](https://github.com/alloc/vite-plugin-compress) does

**node version:** >=12.0.0

**vite version:** >=2.0.0-beta.68
**vite version:** >=2.0.0

```
yarn add vite-plugin-compression -D
Expand Down Expand Up @@ -45,7 +45,7 @@ export default () => {
| verbose | `boolean` | `true` | Whether to output the compressed result in the console |
| filter | `RegExp or (file: string) => boolean` | `DefaultFilter` | Specify which resources are not compressed |
| disable | `boolean` | `false` | Whether to disable |
| threshold | `number` | - | It will be compressed if the volume is larger than threshold, the unit is kb |
| threshold | `number` | `1025` | It will be compressed if the volume is larger than threshold, the unit is b |
| algorithm | `string` | `gzip` | Compression algorithm, optional ['gzip','brotliCompress' ,'deflate','deflateRaw'] |
| ext | `string` | `.gz` | Suffix of the generated compressed package |
| compressionOptions | `object` | - | The parameters of the corresponding compression algorithm |
Expand Down
4 changes: 2 additions & 2 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

**node version:** >=12.0.0

**vite version:** >=2.0.0-beta.68
**vite version:** >=2.0.0

```
yarn add vite-plugin-compression -D
Expand Down Expand Up @@ -45,7 +45,7 @@ export default () => {
| verbose | `boolean` | `true` | 是否在控制台输出压缩结果 |
| filter | `RegExp or (file: string) => boolean` | `DefaultFilter` | 指定哪些资源不压缩 |
| disable | `boolean` | `false` | 是否禁用 |
| threshold | `number` | - | 体积大于 threshold 才会被压缩,单位 kb |
| threshold | `number` | - | 体积大于 threshold 才会被压缩,单位 b |
| algorithm | `string` | `gzip` | 压缩算法,可选 [ 'gzip' , 'brotliCompress' ,'deflate' , 'deflateRaw'] |
| ext | `string` | `.gz` | 生成的压缩包后缀 |
| compressionOptions | `object` | - | 对应的压缩算法的参数 |
Expand Down
12 changes: 6 additions & 6 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"test:br": "npm run build && http-server dist --cors --brotli -c-1"
},
"dependencies": {
"vue": "^3.0.5"
"vue": "^3.0.7"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.1.4",
"@vitejs/plugin-vue-jsx": "^1.1.0",
"@vue/compiler-sfc": "^3.0.5",
"@vitejs/plugin-vue": "^1.1.5",
"@vitejs/plugin-vue-jsx": "^1.1.2",
"@vue/compiler-sfc": "^3.0.7",
"cross-env": "^7.0.3",
"http-server": "^0.12.3",
"typescript": "^4.1.5",
"vite": "^2.0.2"
"typescript": "^4.2.2",
"vite": "^2.0.4"
}
}
255 changes: 120 additions & 135 deletions example/yarn.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@
"fs-extra": "^9.1.0"
},
"peerDependencies": {
"vite": ">=2.0.0-beta.64"
"vite": ">=2.0.0"
},
"devDependencies": {
"@types/chalk": "^2.2.0",
"@types/debug": "^4.1.5",
"@types/fs-extra": "^9.0.7",
"@types/fs-extra": "^9.0.8",
"@types/node": "^14.14.31",
"conventional-changelog-cli": "^2.1.1",
"ini": "^2.0.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"tsup": "^3.12.1",
"typescript": "^4.1.5",
"vite": "^2.0.2"
"tsup": "^4.6.0",
"typescript": "^4.2.2",
"vite": "^2.0.4"
}
}
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface VitePluginCompression {
verbose?: boolean;
/**
* Minimum file size before compression is used.
* @default 2050
* @default 1025
*/
threshold?: number;
/**
Expand Down
99 changes: 47 additions & 52 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"@nodelib/fs.scandir" "2.1.4"
fastq "^1.6.0"

"@rollup/plugin-node-resolve@^11.1.0":
version "11.1.1"
resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.1.1.tgz#47bc34252914794a1b06fb50371d7520a03f91f3"
integrity sha512-zlBXR4eRS+2m79TsUZWhsd0slrHUYdRx4JF+aVQm+MI0wsKdlpC2vlDVjmlGvtZY1vsefOT9w3JxvmWSBei+Lg==
"@rollup/plugin-node-resolve@^11.2.0":
version "11.2.0"
resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz#a5ab88c35bb7622d115f44984dee305112b6f714"
integrity sha512-qHjNIKYt5pCcn+5RUBQxK8krhRvf1HnyVgUCcFFcweDS7fhkOLZeYh0mhHK6Ery8/bb9tvN/ubPzmfF0qjDCTA==
dependencies:
"@rollup/pluginutils" "^3.1.0"
"@types/resolve" "1.17.1"
Expand Down Expand Up @@ -82,10 +82,10 @@
resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==

"@types/fs-extra@^9.0.7":
version "9.0.7"
resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.7.tgz#a9ef2ffdab043def080c5bec94c03402f793577f"
integrity sha512-YGq2A6Yc3bldrLUlm17VNWOnUbnEzJ9CMgOeLFtQF3HOCN5lQBO8VyjG00a5acA5NNSM30kHVGp1trZgnVgi1Q==
"@types/fs-extra@^9.0.8":
version "9.0.8"
resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.8.tgz#32c3c07ddf8caa5020f84b5f65a48470519f78ba"
integrity sha512-bnlTVTwq03Na7DpWxFJ1dvnORob+Otb8xHyUqUWhqvz/Ksg8+JXPlR52oeMSZ37YEOa5PyccbgUNutiQdi13TA==
dependencies:
"@types/node" "*"

Expand Down Expand Up @@ -216,10 +216,10 @@ builtin-modules@^3.1.0:
resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887"
integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==

cac@^6.7.1:
version "6.7.1"
resolved "https://registry.npmjs.org/cac/-/cac-6.7.1.tgz#0609d28a31d887746de4b66a15e3914f106f880c"
integrity sha512-LfGt47+ugCY65W4yUEyxnZKd/tJSBJD/gUAxQGiQjH7yqdhbaX2XN0Rli4+0W0DJiDONmYeh0TlJxMtXGZspIg==
cac@^6.7.2:
version "6.7.2"
resolved "https://registry.npmjs.org/cac/-/cac-6.7.2.tgz#e7f0d21f4776c46c7d0de7976e56fa5562e17597"
integrity sha512-w0bH1IF9rEjdi0a6lTtlXYT+vBZEJL9oytaXXRdsD68MH6+SrZGOGsu7s2saHQvYXqwo/wBdkW75tt8wFpj+mw==

callsites@^3.0.0:
version "3.1.0"
Expand Down Expand Up @@ -569,15 +569,10 @@ error-ex@^1.2.0, error-ex@^1.3.1:
dependencies:
is-arrayish "^0.2.1"

esbuild@^0.8.34:
version "0.8.40"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.40.tgz#2ca457d950b27c77f28010f4482bdb820560290f"
integrity sha512-IP0GcO3K9yO9rM69AMtx9tmjUYFO7oCcRfURCV4KveL3HQnQA1SJ8YLM71EyFe67+7At6HJIyjkOjGO3xnUQ/g==

esbuild@^0.8.47:
version "0.8.50"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.50.tgz#ebf24fde0cdad1a369789dd6fd7a820b0a01e46c"
integrity sha512-oidFLXssA7IccYzkqLVZSqNJDwDq8Mh/vqvrW+3fPWM7iUiC5O2bCllhnO8+K9LlyL/2Z6n+WwRJAz9fqSIVRg==
esbuild@^0.8.52, esbuild@^0.8.53:
version "0.8.54"
resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.54.tgz#2f32ff80e95c69a0f25b799d76a27c05e2857cdf"
integrity sha512-DJH38OiTgXJxFb/EhHrCrY8eGmtdkTtWymHpN9IYN9AF+4jykT0dQArr7wzFejpVbaB0TMIq2+vfNRWr3LXpvw==

escape-string-regexp@^1.0.5:
version "1.0.5"
Expand Down Expand Up @@ -1362,10 +1357,10 @@ pirates@^4.0.1:
dependencies:
node-modules-regexp "^1.0.0"

postcss-load-config@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.0.0.tgz#850bb066edd65b734329eacf83af0c0764226c87"
integrity sha512-lErrN8imuEF1cSiHBV8MiR7HeuzlDpCGNtaMyYHlOBuJHHOGw6S4xOMZp8BbXPr7AGQp14L6PZDlIOpfFJ6f7w==
postcss-load-config@^3.0.1:
version "3.0.1"
resolved "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.0.1.tgz#d214bf9cfec1608ffaf0f4161b3ba20664ab64b9"
integrity sha512-/pDHe30UYZUD11IeG8GWx9lNtu1ToyTsZHnyy45B4Mrwr/Kb6NgYl7k753+05CJNKnjbwh4975amoPJ+TEjHNQ==
dependencies:
cosmiconfig "^7.0.0"
import-cwd "^3.0.0"
Expand Down Expand Up @@ -1550,20 +1545,20 @@ rollup-plugin-dts@^2.0.1:
optionalDependencies:
"@babel/code-frame" "^7.10.4"

rollup@^2.38.0:
version "2.38.4"
resolved "https://registry.npmjs.org/rollup/-/rollup-2.38.4.tgz#1b84ea8728c73b1a00a6a6e9c630ec8c3fe48cea"
integrity sha512-B0LcJhjiwKkTl79aGVF/u5KdzsH8IylVfV56Ut6c9ouWLJcUK17T83aZBetNYSnZtXf2OHD4+2PbmRW+Fp5ulg==
optionalDependencies:
fsevents "~2.3.1"

rollup@^2.38.5:
version "2.38.5"
resolved "https://registry.npmjs.org/rollup/-/rollup-2.38.5.tgz#be41ad4fe0c103a8794377afceb5f22b8f603d6a"
integrity sha512-VoWt8DysFGDVRGWuHTqZzT02J0ASgjVq/hPs9QcBOGMd7B+jfTr/iqMVEyOi901rE3xq+Deq66GzIT1yt7sGwQ==
optionalDependencies:
fsevents "~2.3.1"

rollup@^2.39.0:
version "2.40.0"
resolved "https://registry.npmjs.org/rollup/-/rollup-2.40.0.tgz#efc218eaede7ab590954df50f96195188999c304"
integrity sha512-WiOGAPbXoHu+TOz6hyYUxIksOwsY/21TRWoO593jgYt8mvYafYqQl+axaA8y1z2HFazNUUrsMSjahV2A6/2R9A==
optionalDependencies:
fsevents "~2.3.1"

run-parallel@^1.1.9:
version "1.1.10"
resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz#60a51b2ae836636c81377df16cb107351bcd13ef"
Expand Down Expand Up @@ -1712,7 +1707,7 @@ strip-indent@^3.0.0:
dependencies:
min-indent "^1.0.0"

sucrase@^3.17.0:
sucrase@^3.17.1:
version "3.17.1"
resolved "https://registry.npmjs.org/sucrase/-/sucrase-3.17.1.tgz#b5e35ca7d99db2cc82b3e942934c3746b41ff8e2"
integrity sha512-04cNLFAhS4NBG2Z/MTkLY6HdoBsqErv3wCncymFlfFtnpMthurlWYML2RlID4M2BbiJSu1eZdQnE8Lcz4PCe2g==
Expand Down Expand Up @@ -1817,23 +1812,23 @@ ts-interface-checker@^0.1.9:
resolved "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699"
integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==

tsup@^3.12.1:
version "3.12.1"
resolved "https://registry.npmjs.org/tsup/-/tsup-3.12.1.tgz#53fac0d325d800c524fd6173bc63a41e2d7b41b3"
integrity sha512-W9/XQ7JTEt1iuybQLVk0eNKYBfuIbQ7uvVVyBg6xSEL0XrIdi8sWKj9W2wC8e9KRpXwtQtSZ1a4wnqQMQiIH3w==
tsup@^4.6.0:
version "4.6.0"
resolved "https://registry.npmjs.org/tsup/-/tsup-4.6.0.tgz#cfa1cbdf283254730045a96dfbef624705cd53d1"
integrity sha512-euXDY7FZE/PY6CFvWYOI2gyk1nXXYdK2mtOUfjHOncIZkJDdEyTb+DBnOEXPl85TNm0lFPZvCzzoYmDMKTqeIQ==
dependencies:
"@rollup/plugin-node-resolve" "^11.1.0"
cac "^6.7.1"
"@rollup/plugin-node-resolve" "^11.2.0"
cac "^6.7.2"
chalk "^4.1.0"
chokidar "^3.5.1"
esbuild "^0.8.34"
esbuild "^0.8.53"
globby "^11.0.2"
joycon "^2.2.5"
postcss-load-config "^3.0.0"
postcss-load-config "^3.0.1"
resolve-from "^5.0.0"
rollup "^2.38.0"
rollup "^2.39.0"
rollup-plugin-dts "^2.0.1"
sucrase "^3.17.0"
sucrase "^3.17.1"

type-fest@^0.18.0:
version "0.18.1"
Expand All @@ -1850,10 +1845,10 @@ type-fest@^0.8.1:
resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==

typescript@^4.1.5:
version "4.1.5"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72"
integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==
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==

uglify-js@^3.1.4:
version "3.12.6"
Expand Down Expand Up @@ -1883,12 +1878,12 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"

vite@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/vite/-/vite-2.0.2.tgz#d984528b5a1c8e725d2804245751769b11d671cf"
integrity sha512-X+PTIPRt6/5Odf/h0kBkwkck+YC0I6oKH5+ttA9ytoLyC9yeksktVq1KNzImqB+/1CNBiBE2vr7orcgSxAi67w==
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==
dependencies:
esbuild "^0.8.47"
esbuild "^0.8.52"
postcss "^8.2.1"
resolve "^1.19.0"
rollup "^2.38.5"
Expand Down

0 comments on commit d37e87d

Please sign in to comment.