Skip to content

PR #6251 generates a HUGE async-vendor chunk dispite the packages are imported from different async chunks #6289

@QiroNT

Description

@QiroNT

Describe the bug

PR #6251 introduced a separate chunk for async imports to improve cache hits which is great to have.

The problem is it generates a single chunk for all async imports, which results in all packages imported async-ly to be packed into one huge(in my case >1MB) file.

I think it should be at least keyed chunks so packages from different async chunks will be written separately.

vite v2.7.7:
图片

vite v2.7.8:
图片

Reproduction

https://github.com/QiroNT/vite-reps/tree/vite-6251

System Info

System:
    OS: Linux 5.14 Manjaro Linux
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 12.65 GB / 31.30 GB
    Container: Yes
    Shell: 5.1.12 - /bin/bash
  Binaries:
    Node: 17.3.0 - ~/.local/share/pnpm/node
    npm: 8.3.0 - ~/.local/share/pnpm/npm
  Browsers:
    Firefox: 95.0.1
  npmPackages:
    @vitejs/plugin-vue: ^2.0.1 => 2.0.1 
    vite: ^2.7.8 => 2.7.8

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions