It can scale but it takes an increadible amount of care.
Everything has to have unit tests and documentation and be split out into reasonable modules. Large scale projects in C are honestly easier to work on than JavaScript.
It does scale but almost no one puts in the effort to do it.
If writing a lot of support code is inevitable anyway, why not automate writing tests, etc? That is, why not write a proper translator from a more expressive language? Something like Elm, maybe.
Everything has to have unit tests and documentation and be split out into reasonable modules. Large scale projects in C are honestly easier to work on than JavaScript.
It does scale but almost no one puts in the effort to do it.