Skip to content

[Bug]: setting output.comments.annotation: false causes the tree-shaking not working in some cases #8655

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

REPL

What is expected?

The output to be the same without output.comments.annotation: false:

//#region icons.mjs
const AIcon = /* @__PURE__ */ window.bar(function() {
	return 1;
});
//#endregion
//#region index.mjs
console.log(AIcon);
//#endregion

What is actually happening?

The output is:

//#region icons.mjs
const AIcon = window.bar(function() {
	return 1;
});
window.bar(function() {
	return 2;
});
//#endregion
//#region index.mjs
console.log(AIcon);
//#endregion

System Info

1.0.0-rc.8

Any additional comments?

Originally reported at vitejs/vite#21825

Metadata

Metadata

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions