> but it's weird that normal code and control flow influences compilation. In other languages this would be a macro or something that clearly expresses that it's metaprogramming.
Similar kind of thing happens in zig during comptime execution.
It's all acceptable if it at least is documented explicitly and correctly. But I do think sveltekits documentation is a bit sparse and doesn't go into detail about such things.
This is what I would call "magic" or implicit behavior. It seems very nice to have that at first but in reality after significant use of something there will come a point at which one wants to fully understand how it works. The magic then needs to be demystified.
Similar kind of thing happens in zig during comptime execution.