Stefan Oltmann
11/19/2024, 3:29 PMandylamax
11/19/2024, 5:22 PMbinaries.library()
and then when you build, you should have a javascript bundle ready to be consumed (assuming you have exported your declarations)Stefan Oltmann
11/19/2024, 7:11 PMbuild/kotlin-webpack/js/productionExecutable
are minimal - 500 byte for the JS and 2 KB for the map
Can't be right. And why do I get a map
anyway?
I want a JS file that can do everything that the JAR file can do.Stefan Oltmann
11/19/2024, 7:12 PMStefan Oltmann
11/21/2024, 9:07 PMandylamax
11/21/2024, 9:22 PMjs {
browser()
nodejs()
binaries.libary()
}
Stefan Oltmann
11/21/2024, 9:59 PMjs(IR) {
browser {
binaries.executable()
}
}
But that's not giving me a usable JS file, too.Stefan Oltmann
11/21/2024, 10:02 PMCould not determine the dependencies of task ':allTests'.
> Could not create task ':jsProductionLibraryCompileSync'.
> Extension with name 'kotlinNodeJs' does not exist. Currently registered extension names: [ext, versionCatalogs, kotlin, kotlinTestRegistry, base, defaultArtifacts, sourceSets, reporting, javaToolchains, java, kotlinArtifacts, android, androidComponents, buildOutputs, publishing, signing, detekt, sonar, sonarqube, kover, koverMerged, buildTimeTracker, gitVersioning, kotlinScripting]
Stefan Oltmann
11/21/2024, 10:09 PMjs(IR) {
useCommonJs()
binaries.executable()
browser {}
}
This seems to do something until the unit test fails due to missing ChromeHeadlessStefan Oltmann
11/21/2024, 10:12 PMStefan Oltmann
11/21/2024, 10:18 PMStefan Oltmann
11/21/2024, 10:26 PMandylamax
11/21/2024, 10:26 PMbinaries.library()
, not binaries.executable()
right?andylamax
11/21/2024, 10:27 PMStefan Oltmann
11/21/2024, 10:28 PMandylamax
11/21/2024, 10:29 PMStefan Oltmann
11/21/2024, 10:29 PMjs(IR) {
browser()
nodejs()
binaries.library()
binaries.executable()
}
works, if turned off the testsStefan Oltmann
11/21/2024, 10:29 PMandylamax
11/21/2024, 10:30 PMgradle.properties
file
kotlin.js.ir.output.granularity=whole-program
Stefan Oltmann
11/21/2024, 10:30 PMandylamax
11/21/2024, 10:30 PMbinaries.executable()
and leave the binaries.library()
Stefan Oltmann
11/21/2024, 10:32 PMjs(IR) {
browser()
nodejs()
}
andylamax
11/21/2024, 10:35 PMjs(IR) {
browser()
nodejs()
binaries.library()
}
andylamax
11/21/2024, 10:36 PMStefan Oltmann
11/21/2024, 10:36 PMStefan Oltmann
11/21/2024, 10:38 PMStefan Oltmann
11/21/2024, 10:40 PMStefan Oltmann
11/21/2024, 10:45 PMStefan Oltmann
11/21/2024, 10:48 PMjsBrowserDevelopmentLibraryDistribution
looks way more like what I expectandylamax
11/21/2024, 11:18 PMandylamax
11/21/2024, 11:19 PMStefan Oltmann
11/21/2024, 11:24 PMStefan Oltmann
11/21/2024, 11:25 PMjs(IR) {
browser {
// FIXME Not working
webpackTask {
sourceMaps = false
}
// FIXME Not working
commonWebpackConfig {
sourceMaps = false
}
}
// nodejs()
binaries.library()
compilations.all {
compileTaskProvider.configure {
compilerOptions.freeCompilerArgs.add("-Xir-minimized-member-names=false")
}
}
}
Stefan Oltmann
11/21/2024, 11:26 PMjsBrowserDevelopmentLibraryDistribution
looks like it's what I need. But "development" doesn't sound good.
But jsBrowserProductionLibraryDistribution
does produce something that looks like a stub.Stefan Oltmann
11/21/2024, 11:26 PMStefan Oltmann
11/21/2024, 11:27 PMStefan Oltmann
11/21/2024, 11:28 PMStefan Oltmann
11/21/2024, 11:29 PMStefan Oltmann
11/21/2024, 11:29 PMStefan Oltmann
11/21/2024, 11:32 PMandylamax
11/21/2024, 11:35 PMStefan Oltmann
11/21/2024, 11:37 PMandylamax
11/21/2024, 11:37 PMStefan Oltmann
11/21/2024, 11:38 PMandylamax
11/21/2024, 11:38 PMStefan Oltmann
11/21/2024, 11:39 PMhttps://kotlinlang.slack.com/files/U025FAKGGJY/F081WGQFY3F/image.png▾
Stefan Oltmann
11/21/2024, 11:40 PMStefan Oltmann
11/21/2024, 11:42 PMStefan Oltmann
11/22/2024, 1:17 PM