browserTargetNames

abstract val browserTargetNames: ListProperty<String>

Exact Kotlin/JS target names that are configured for a browser runtime and may receive the generated helper. Default empty, so generation fails closed instead of attaching browser APIs to an unknown or Node.js-only target.

For the conventional js { browser() } target:

browserTargetNames.add("js")

Custom targets use their declared target name, for example js("web") uses "web". A listed name that does not identify a Kotlin/JS target is a configuration error.