Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created October 25, 2024 07:09
Show Gist options
  • Save skydoves/5d17bea13ec439ceff564a15dc934a76 to your computer and use it in GitHub Desktop.
Save skydoves/5d17bea13ec439ceff564a15dc934a76 to your computer and use it in GitHub Desktop.
kmp_arch
kotlin {
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
val rootDirPath = project.rootDir.path
val projectDirPath = project.projectDir.path
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(rootDirPath)
add(projectDirPath)
}
}
}
}
binaries.executable()
}
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment