sdeleuze
08/14/2022, 9:07 AM1.7.20-Beta
that "exports" fun add(a: Int, b: Int): Int = a + b
. I don't care about JavaScript here, I just want to specify that the generated Wasm should be shipped with this function and everything else removed (tree shaking). I have no main()
in my project. How should I specify that in my code and/or how my build configuration kotlin { wasm { binaries.library() } }
should be customized? Is @JsExport
the way to go for now?Svyatoslav Kuzmich [JB]
08/17/2022, 2:19 PMbinaries.executable()
and @JsExport
would be the way to go for now.Svyatoslav Kuzmich [JB]
08/17/2022, 2:20 PMsdeleuze
08/18/2022, 5:49 PMbinaries.library()
+ @WasmExport
for that use case or if you have something else in mind. Other languages usually uses keyword instead of @JsExport
/ @WasmExport
but maybe there is not enough use cases on other platforms to justify such keyword in Kotlin ...