How to use dead code elimination in multiplatform project?

I found this:

But trying to follow the docs there to apply the plugin fails:

plugins {
    id("kotlin-multiplatform") version "1.3.31"

Build file ‘/…/build.gradle.kts’ line: 18
Plugin [id: ‘kotlin-dce-js’] was not found in any of the following sources:

Where is it? If it’s already in the kotlin-multiplatform plugin, where are the tasks? Is there an example or documentation somewhere?

I see there is another plugin called kotlin frontend plugin. Maybe I should use that instead?

This question mostly about how to use Gradle Kotlin DSL
I dont use kotlin-multiplatform plugin. Just only Kotlin/JS. And this work fo me:

plugins {
    id("kotlin2js") version "1.3.31"

apply {

Add the following code to your settings.gradle:

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if ( == "kotlin-dce-js") {
1 Like

Thank you, that works. There was a similar if branch already there for "kotlin-multiplatform".