Yeah, I decided to not use engines like Unity or Godot that can export to HTML because I feel that these engines bring a lot of overhead with them. Even when exporting an empty scene with nothing happening, the resulting HTML files will still have a considerable file size.
I am not writing my own rendering engine from scratch though, I am using three.js, which covers a lot of the basics, which helps a lot. :-)
But, more complex features like level of detail functionality you still have to do yourself.