Deprecation warning: use cssSupport methods instead

I’m using Kotlin/JS as part of a Multiplatform project, and I followed the instructions I found in the documentation and elsewhere to add CSS support via the Gradle file (from the kotlin section):

    js {
        browser {
            commonWebpackConfig {
                cssSupport.enabled = true
                devServer?.port = 9091
                devServer?.proxy = mutableMapOf(
                    "/api/" to mutableMapOf(
                        "target" to "http://localhost:9090",
                        "secure" to false
                    )
                )
            }
            binaries.executable()
        }
    }

For quite some time I have been getting this warning:

Warning:(50, 17) 'cssSupport: KotlinWebpackCssRule' is deprecated. use cssSupport methods instead

I don’t really understand what it is trying to tell me to do, and all the documentation seems to still show what I have. Could someone help me and point out how I am supposed to do this so that I don’t get a warning?

Thanks in advance.

Peter

1 Like

I believe this youtrack issue refers to the same warning. It seems the DSL has changed to the following format instead:

browser {
    commonWebpackConfig {
        cssSupport {
            // In 1.7.20:
            enabled = true
            // In 1.8.0:
            enabled.set(true)
        }
    }
    ...
}
1 Like

Thanks, @chipays - that seems to be the trick. I hope the documentation will update soon, and the warning message doesn’t seem helpful even in hindsight.

But I’m back on track, thanks for that.