I have developed a C++ library using Embind and Emscripten.
In addition to the library, I have included some manually written JS code using --pre-js
While the library is working fine, I want to restructure the code as follows:
var MYLIB = (function(){
// ... Original Code ...
return Module;
})();
This way, the code will not clutter the global namespace, allowing for better optimizations by code minifiers.
Is there a built-in functionality within emcc
for achieving this?
Please note that the library is meant to run only in web browsers, not in Node.js.