Alex Styl
06/05/2025, 8:57 AMAlex Styl
06/05/2025, 8:59 AMpackage com.composables
@OptIn(ExperimentalJsExport::class)
@JsExport
fun svgToComposeImageVector(svg: String, variableName: String = "Output"): String {
}
I build my lib using: jsNodeDevelopmentLibraryDistribution
then copy paste the generated lib folder into my nodejs app
I cannot figure out how to import it. I see this weird code generated in the generated js file:
function $jsExportAll$(_) {
var $com = _.com || (_.com = {});
var $com$composables = $com.composables || ($com.composables = {});
$com$composables.svgToComposeImageVector = svgToComposeImageVector;
}
$jsExportAll$(_);
and I can't figure out how to import the svgToComposeImageVector
functionAlex Styl
06/05/2025, 9:35 AMnpm i /path/to/exported/kotlin/lib
and I can use it as a normal installed moduleEdoardo Luppi
06/05/2025, 10:02 AM_
symbol is the root namespace of the exported library. I suppose you're using CommonJS.Artem Kobzar
06/05/2025, 10:02 AMAlex Styl
06/05/2025, 7:42 PMArtem Kobzar
06/06/2025, 9:44 AMnpm i /path/to/exported/kotlin/lib
is the best solution for the local developmentEdoardo Luppi
06/06/2025, 9:52 AMnpm link
, which creates a symbolic link and allows you (in theory, but doesn't always keep its promise) to simply compile the distribution without having to re-install each time. It's still not the best solution tho. That's why I prefer monorepos with npm workspaces.