I’m trying kotlin-js again for the first time in a...
# javascript
s
I’m trying kotlin-js again for the first time in a while. I have a simple module with some JS code compiling using the new IR compiler. What’s the easiest way for me to provide a separate isolated piece of js code for a team to use in a browser?
b
As in js npm package for them to consume via yarn or npm?
s
that’s a worst case scenario
a best case scenario is that I just have a separate artifact hosted somewhere that they can pull into a page dynamically
b
Oh, then it's even simpler. Use binaries.executable() and then run jsBrowserDistribution task. Afterwards you'll find your js file in build/distribution
s
jsBrowserDistribution
will that be properly minified etc?
and compiled for production?
b
Yes
s
I’m a little disappointed that I ran that compilation and the file generated is 173kb
the app does nothing so far lol
It’s including a bunch of stuff that I don’t really use
b
That's expected. Kjs has quite some initial bloat which becomes less significant as your app grows
s
I need to configure it to compile to plain js right?
b
Shouldn't need to