Skip to content

minifier: drop functions, even when used recursively #13105

@KTibow

Description

@KTibow
This is related to parity with this Rollup optimization

I've been messing around with bundling Svelte, and an important learning is that Rollup makes more complex optimizations than you might expect. Some of these optimizations aren't even found in Terser and esbuild, but they'll be needed in OXC if Rolldown is going to compete with Rollup in bundle size.

function a() {}
function b() {
  if (Math.random() > 0.1) b();
}
function c() {
  if (Math.random() > 0.1) d();
}
function d() {
  if (Math.random() > 0.1) c();
}

should minify to 0 bytes.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions