Are you very sure that you need to simplify these meshes after loading the model in three.js? In 99% of cases it’s better to simplify the model before the webpage ever downloads it, and easier too. Use gltfpack or gltf-transform directly for that. Or Blender’s Decimate modifier.
If you need to do simplification at runtime after loading, three.js also has a built-in simplify modifier:
https://threejs.org/examples/?q=simpl#webgl_modifier_simplifier
… which would probably be easier for you to use, and has existing examples.
If you really want to use meshoptimizer at runtime to do simplification, we can probably help you do that, but I just want to make sure you’re aware that you’re doing this the hard way.