Skip to content

[Feature Request]: remove non used dynamic import chunks #3403

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

  1. Open https://stackblitz.com/edit/github-nci4o6nk-sghysh6m?file=src%2Fa.js,src%2Fb.js,src%2Findex.js
  2. npm i runs automatically
  3. npm run build runs automatically

What is expected?

No file in dist directory to include "should not be included".

What is actually happening?

dist/b-hash.js includes "should not be included".

System Info

Stackblitz

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    rolldown: 1.0.0-beta.2-commit.2666b23 => 1.0.0-beta.2-commit.2666b23

Any additional comments?

Rollup supports this (rollup REPL).

I found this while testing rolldown-vite in ecosystem-ci. There's a test in vite-plugin-svelte that expects the non-used file to be not included in the dist.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions