grahamborland
02/04/2022, 5:32 PM.js
and .js.map
files to the distribution directory, but not the .d.ts
file. Is there a way to get that file included too?Big Chungus
02/04/2022, 5:57 PMgrahamborland
02/04/2022, 6:10 PMjs(IR) {
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
distribution {
}
webpackTask {
outputFileName = "sliktest.js"
}
}
binaries.executable()
useCommonJs()
}
Big Chungus
02/04/2022, 6:18 PMexecutable
if you need .d.ts
files. Change it to binaries.library()
grahamborland
02/04/2022, 6:24 PMBig Chungus
02/04/2022, 6:27 PMgrahamborland
02/04/2022, 6:31 PMbinaries.library()
causes Gradle sync to fail in the IDE with a weird internal intellij stacktrace, but at least on the command line it does now include the d.ts
in the distribution. Thanks for the help. 🙂Big Chungus
02/04/2022, 6:36 PMBig Chungus
02/04/2022, 6:37 PM./gradlew packJsNpmpublication
should produce all you need to distribute your lib in build/publications/npm/js
Big Chungus
02/04/2022, 6:56 PMpwd # IdeaProjects/my-project/kotlin-lib
./gradlew pack
cd ../ts-app
pwd # IdeaProjects/my-project/ts-app
yarn install ../kotlin-lib/build/publications/npm/js-1.0.0.tar.gz
Big Chungus
02/04/2022, 6:57 PM