'module not found while running kotlin/js built code

i'm facing following problem while running js code, compiled by gradle from kotlin/js: in the head of the compile js file there is code:

  else if (typeof exports === 'object')
factory(module.exports);

but somehow my environment (tray.io) supports only multi exports way (like exports.step =function(input){...}) and throws me an error:

module is not defined

if i manually change compiled code to:

      else if (typeof exports === 'object')
factory(exports);

everything works fine. can i somehow have this done via some kotlin annotations/configurations? definitely will talk to tray.io for support of a module, but may be it's possible to solve with kotlin features. i have tried all js module systems and browser/node configurations, but the compiled code is still the same.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source