nonzzz / vite-plugin-compression

vite plugin. compress your bundle file.
MIT License
162 stars 9 forks source link

threshold选项对某些js文件不生效 #33

Closed liuxiaofanRZ closed 1 year ago

liuxiaofanRZ commented 1 year ago

Bug report 🐞

配置如下

compression({ threshold: 1024 * 80 })

但打包时小于80kb的js文件也被压缩了:

image

具体复现流程:npm init vue@latest创建项目,只选择vue-router功能,引入了本插件并设置threshhold为80*1024,然后build。

Version & Environment

{
  "dependencies": {
    "vue": "^3.3.4",
    "vue-router": "^4.2.2"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^4.2.3",
    "vite": "^4.3.9",
    "vite-plugin-compression2": "^0.10.0"
  }
}
nonzzz commented 1 year ago

看起来确实是插件的问题。我会尽快进行修复感谢你的反馈

nonzzz commented 1 year ago

我对其进行了修复并且发布了v0.10.1. @liuxiaofanRZ

liuxiaofanRZ commented 1 year ago

非常感谢~