Hi all - i’m new to kotlin-js. Is there any good e...
# javascript
x
Hi all - i’m new to kotlin-js. Is there any good example project that showcase kotlin sources exported as a js library and consumed through npm?
v
There is the
npm-publish
plugin. I'd guess it contains some examples.
b
Yeah, just drop in npm-publish and it should configure itself. Then you can run pack task to get npm tarballs. Once you add npm repo, you'll also get npmPublishing tasks.
x
awesome - thanks guys
a
@Big Chungus does npm-publish work to publish multiple modules with interdependencies? Or only to publish one independent mega-module with everything bundled together?
b
It doesn't bundle npm dependencies, only klibs since they're not on npm
a
But does each klib get its own separate bundle, even if it declares a dependency on another klib?
b
If you have a klib that depends on ktor for example, all the ktor stuff that you use will be bundled into generated js file
BUT you could publish each module individually as npm lib and add them to other modules as npm dependencies. That way they won't get bundled
You can use pack task to generate a tarball and depend on that locally (without having to publish anything)