https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
g

Gopal S Akshintala

04/25/2022, 5:54 PM
Hi, I am trying to bundle
moment.js
into my jar and this is what I have tried. https://github.com/overfullstack/revoman-root/blob/master/src/jsMain/kotlin/Main.kt But the final bundle generated doesn’t have the moment functions as expected. Am I doing it right?
b

Big Chungus

04/25/2022, 6:05 PM
And it won't until you declare your external definitions. That annotation just tells the compiler which module should be linked against external definitions in the file
g

Gopal S Akshintala

04/25/2022, 6:09 PM
Thanks @Big Chungus, I m a newbie in kotlin js n could find examples. Do you mind directing me to any examples you know, write a code snippet to achieve this. Do I need to write external definitions for all functions in moment?
b

Big Chungus

04/25/2022, 6:10 PM
Getting a decent grip on externals is no small feat. It's a steep learning curve ;)
The article should get you going at least
Give it a read and if you still get stuck ping me back here or in DM and we can discuss your particular issues.
3 Views