All the code that is needed for a js build of plantuml is already in plantuml's main repository - all we need is to build it with cheerpj and do some string decoding on the javascript side.
I've made a <26 line build script that can take the latest plantuml version (as of 2024) and turn it into a file that can be interpreted by cheerpj in https://github.com/acenturyandabit/plantuml.nano.js.