io.github.scottpierce.kotlin-node-slim
Owner: Scott Pierce
Creates a slim nodejs project of only the dependencies used by a Kotlin Node JS Gradle module so that only the used dependencies can be packaged. This helps to greatly reduce the released file size, especially in projects with multiple javascript projects.
https://github.com/ScottPierce/kotlin-node-slim
Sources: https://github.com/ScottPierce/kotlin-node-slim
Version 0.0.9 (latest)
0.0.9
Created 11 July 2023.
When releasing a module in Kotlin JS, all dependencies from all other js projects are included in the node_modules directory. This adds significant bloat when trying to package a Kotlin nodejs application in a docker container, or ship it as a standalone application.
This plugin iterates over the dependencies of the module recursively, collects all referenced npm dependencies, and then generates a small npm project.
Using the plugins DSL:
plugins {
id("io.github.scottpierce.kotlin-node-slim") version "0.0.9"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("io.github.scottpierce.kotlin-node-slim:kotlin-node-slim:0.0.9")
}
}
apply(plugin = "io.github.scottpierce.kotlin-node-slim")
Using the plugins DSL:
plugins {
id "io.github.scottpierce.kotlin-node-slim" version "0.0.9"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.github.scottpierce.kotlin-node-slim:kotlin-node-slim:0.0.9"
}
}
apply plugin: "io.github.scottpierce.kotlin-node-slim"