I haven't been able to find docs or examples for --pre-js. Can anyone point in the right direction?
I worked out that it's "--pre-js=foo.js", not "--pre-js foo.js". I don't understand the module system, though, and can't access the functions defined in the file.
I was expecting that I would add the functions to EXTRA_EXPORTED_RUNTIME_METHODS, and they would appear on Module. This seems to sort of half work: if I add a function to EXTRA_EXPORTED_RUNTIME_METHODS but fail to set --pre-js, the build will cough up an error, like
shared:ERROR: undefined exported function: "fradixSortL16_64"
After adding --pre-js, this build error disappears, so it seems to be finding the function during build, but the function is not available at run time on Module.