HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.03k stars 648 forks source link

Compiler.exclude() doesn't work for module-level fields #11688

Open R32 opened 3 weeks ago

R32 commented 3 weeks ago

Main.hx

function main() {
    foo();
}

Foo.hx

function foo() {
    trace("hello foo");
}

build.hxml

haxe --main Main --js out.js --macro exclude('Foo')

output :

function Foo_foo() {
    console.log("src/Foo.hx:4:","foo");
}
function Main_main() {
    Foo_foo();
}