How do I add DOM and Math klibs available for wasm...
# multiplatform
b
How do I add DOM and Math klibs available for wasm23 target to MPP project via gradle?
I've found this example with precompiled libs using konan plugin, but I'd like to know how to at least do that with MPP plugin: https://github.com/ftomassetti/kotlin-wasm-examples/blob/master/build.gradle
t
wasm23 lib must be available only for
JS
part?
b
How do you mean? Wasm32 is native target that's directed to browser
t
You can define in related
sourceSet
b
Copy code
kotlin {
    /* Targets configuration omitted.
    *  To find out how to configure the targets, please follow the link:
    *  <https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets> */
    wasm32("wasm") {
        sourceSets {
            val wasmMain by getting {
                dependencies {
                    implementation(files("$projectDir/lib"))
                }
            }
        }
    }
}
this doesn't work
t
Do you have target declaration?
b
wasm32("wasm") is a target declaration
t
sourceSets
section must be located in
kotlin
section
b
It really doesn't. Anyways, neither works
t
Separate submodule for lib?
b
How do you mean?
t
I mean separate gradle submodule for lib with target
wasm32
only And include submodule with
implementation(project(":my-wasm-lib"))