Skip to content

minifier: remove no-op function call #11469

@sapphi-red

Description

@sapphi-red
function foo() {}
foo()

const bar = () =>{}
bar()

can be replaced with

function foo() {}
const bar = () =>{}

playground


With #11470 + #10033 + this,

let foo = {}
function _setFoo(bar) {
  foo = bar
}
const baz = ""
_setFoo(baz)

export { baz }

can be simplified to

const baz = ""
export { baz }

(this case is generated by astro)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions