How to import css in kotlin multiplatform(only tar...
# javascript
a
How to import css in kotlin multiplatform(only targeted for js right now). I tried adding a css file in in the
jsMain/kotlin
and used
kotlinext.require
but it the build throws an error of module not found in
jsBrowserProductionWebpack
i used the template for fullstack web app from idea i think it enables cssSupport by default as specified in the docs. Is it that i have to specify the file path under gradle as well or do i have to change the location of the css?
b
You need to put it in jsMain/resources
a
It still fails
Copy code
fun main() {
    window.onload = {
        kotlinext.js.require("default.css")
        render(document.getElementById("root")) {
            mainPage()
        }
    }
}
using this produces the same error of module not found for the task
jsBrowserProductionWebpack
b
You might also need this https://github.com/mpetuska/kamp/blob/feature/compose/app/client/webpack.config.d/files.js Also clean all your
**/build
folders and try again.