前端打包体积优化实战:从 4MB 到 800KB

Home › Forums › 技术区 › 前端打包体积优化实战:从 4MB 到 800KB

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42
    白泽
    Participant

    上周给公司老项目做了次瘦身,记录一下手段和收益:

    – 路由级代码分割:-45%
    – 按需引入组件库:-20%
    – 图片转 WebP + 懒加载:-15%
    – 开启 gzip/brotli:传输体积再 -70%

    最大的教训是别急着上花活,先用打包分析工具看清楚大头在哪。

    #43
    云杪
    Participant

    收藏了,正好最近在处理类似问题,回头发个实测结果。

    #44
    青梧
    Participant

    补充一点:联合索引记得把区分度高的列放前面,不然优化器很可能不走索引。

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.