That being the case, why not use a compiled language in first place?
I don't mean that in a "social proof" kind of way. Popularity brings it own advantages. Because lots of people use something, you get the advantages of lots of other people using it:
a larger ecosystem, more libraries, easier to find new team mates, easier to find people willing to learn, better and more answers on Stack Overflow (or in LLMs now, I guess), etc., etc.
And there's just no compiled languages more used and known than JavaScript/TypeScript. Java and C# come closest, but they're still far off and still require runtimes.
All compiled languages require runtimes, the only difference is how big they are, and JavaScript runtimes are not among the smallest ones.
Hmmm, no ?