-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Feature Request: Preserve //# allFunctionsCalledOnLoad
Comment for V8 Explicit Compile Hints
V8 recently introduced a feature called Explicit Compile Hints, which is already available in Chrome 136 and newer.
Currently, esbuild only preserves hashbangs and legal comments by default. It would be helpful if esbuild could also preserve the new //# allFunctionsCalledOnLoad
comment—either by default, via a new option, or based on the target
configuration.
I'm not sure when exactly this should be enabled or disabled (e.g., during build
vs transform
), so I'm open to discussion on the best approach.
Input:
//# allFunctionsCalledOnLoad
function testfunc2() {
// this is a comment
console.log('testfunc2 called!');
}
testfunc2();
current output:
function testfunc2() {
console.log("testfunc2 called!");
}
testfunc2();
desired output:
//# allFunctionsCalledOnLoad
function testfunc2() {
console.log("testfunc2 called!");
}
testfunc2();
Metadata
Metadata
Assignees
Labels
No labels