pheraps it is possible to do it the way you describe.
with this library specifically this problem is very common and is resolved using a lambda layer. as far as I know you can’t do it in plugin ssa. here was shared a reply from support about this.
of course mantaining a custom build ported to webassembly and published on npm is probably a lot more effort than move the logic in a suitable infra or looking for alternative libraries. it’s still a interesting point of view that will have a place in my list of things to try