Kotlin JS doesn't have ESClasses in K2, is it know...
# k2-early-adopters
a
Kotlin JS doesn't have ESClasses in K2, is it known ?
s
cc @anton.bannykh
a
No, it's not known, what's the issue?
a
When using K2 in a JS target with
useEsClasses = true
it actually doesn't produces ESClasses
a
Thanks for reporting, we'll check.
a
@Ayfri, how do you define the
useEsClasses
? I've just try to add the next lines to the hello world application
build.gradle.kts
and seems like it works:
Copy code
tasks.withType<KotlinJsCompile> {
    kotlinOptions.useEsClasses = true
    kotlinOptions.languageVersion = "2.0"
}
a
Here is my configuration :
Copy code
kotlin {
	js {
		sourceSets.all {
			languageSettings {
				optIn("kotlin.ExperimentalJsExport")
				apiVersion = "2.0"
				languageVersion = "2.0"
			}
		}

		compilations.all {
			kotlinOptions {
				metaInfo = true
				typedArrays = true
				useEsClasses = true
			}
		}

		browser {
			commonWebpackConfig(Action {
				devServer?.open = false
				sourceMaps = true
			})
		}

		useEsModules()
		binaries.executable()
	}
}
Nevermind, I think I needed to delete
build
folder and restart JS build