Hello, in an mpp project the js file is generated ...
# javascript
g
Hello, in an mpp project the js file is generated as
umd
. I see that all classes and object (singletons) are generated as function() so I am not sure how I am supposed to use it in JavaScript, as when called I get
undefined
as returned value. Any idea?
b
You could try to use
useCommonJs()
in your
target
configurations
Or configure it to use
amd
Copy code
target {
    //useCommonJs()
    browser()
    compilations.all {
        kotlinOptions.apply {
            moduleKind = "amd"
            sourceMap = true
            sourceMapEmbedSources = null
        }
    }
}