KotlinJS Modules


I see that M10 has js module support now, that's fantastic :)

Any documentation on how it works yet?


What do you mean?

We don’t support js modules yet. But since M9 kotlin.js file is valid CommonJs module.


I'm probably misunderstanding something then. I'm looking at the source created when I have two KotlinJS modules:

(function (Kotlin) {   'use strict';   var _ = Kotlin.defineRootPackage(null, /** @lends _ */ {   HelloWorldJs: Kotlin.createClass(null, null),   main: function (args) {   var s = new Kotlin.modules['UtilsJs'].MyUtil();   Kotlin.println('Hello');   }   });   Kotlin.defineModule('ExampleJs', _);   _.main([]); }(Kotlin));