I've created a library in C++ using Embind and Emscripten.
Some hand written JS code is also added to the library using --pre-js
The library works. But I would like to rearrange the code, to this:
var MYLIB = (function(){
// ... Original Code ...
return Module;
})();
So the code would not pollute the global namespace, and the code minifier could do better optimizations.
Are there build in functions for this in emcc
?
The library will only run in webbrowsers, not in nodejs.