@Marks4 In order to do this now, you have to have a .jspre file to go along with the jslib.
In the .jspre file you need to add an object to the “Module” object so JS can access it via gameInstance.Module.YourObjectName.SomeFunction(). Then you need to add your wrapper functions for each function you want available in JS.
example jslib file:
var CoolJsPlugin= {
$CoolContainer: {
data: "data",
},
CoolFunction: function() {
console.log("Cool");
},
};
autoAddDeps(CoolJsPlugin, '$CoolContainer');
mergeInto(LibraryManager.library, CoolJsPlugin);
example jspre file:
The object created in Module doesn’t have to have same name.
Module['CoolJsPlugin'] = Module['CoolJsPlugin'] || {};
Module['CoolJsPlugin'].RunCoolFunction = function () {
_CoolFunction();
}