Not sure, I’m not familiar with the web ecosystem. Not familiar at all, so my next question will probably be stupid. Would it have been possible to compile your C++ library to WebAssembly?
There was another app where I had a 3x3 shear transformation that I needed to decompose into a rotation * scale * rotation which is exactly what SVD does (see https://tinyurl.com/384mkdvh). No need to bring in a full linear algebra package just for that.