Distributing JavaScript external definitions


#1

What is the canonical way of distributing external definitions for JavaScript libraries,
so that they can be used in other projects?

  • Distribute them in a jar on maven-central? If so, how can gradle be instructed to use these, since they aren’t compiled?
  • Npm
  • other ideas?

#2

I think both are suitable.

If so, how can gradle be instructed to use these, since they aren’t compiled?

They should be compiled unless you have a compilation error.

It should be as usual Kotlin/JS library, so see how to create Kotlin/JS library from command line here. To achieve the same thing in the gradle use metaInfo option (all options)

To distribute using maven-central (or jcenter) you should pack all files from output directory to a jar, but on npm you can distribute them as is.