Monday, June 8, 2020

The kotlin.js plugin obsoletes kotlin2js

I tinkered with a new Kotlin for JavaScript project today and ran into some confusion. The documentation I found frequently mentioned features that didn't seem to be recognized by Gradle and third-party examples did a lot of things that I wouldn't have expected to be necessary. Older documentation mentioned applying a kotlin2js plugin, which apparently had a lot of features but is deprecated in favor of the new Kotlin JS plugin that is applied by default when creating a Kotlin/JS project in IntelliJ. Alternatively, it can be added as a plugin with kotlin("js")

Manual Node setup doesn't seem to be necessary. Dependencies from NPM can be added with implementation(npm(artifact, version)) in the standard dependencies block. I have not yet found a good way to package and deploy for NodeJS, though.

No comments:

Post a Comment