Hello! With kotlin-styled the following ```val x b...
# react
a
Hello! With kotlin-styled the following
Copy code
val x by css {
  backgroundImage = require("src/main/resources/image.png")
}
gives an error
Copy code
Module 'src/main/resources/image.png' not found
Moving file to main/kotlin/... and changing to relative path from the source file dir gives the same "not found" error. Using JsModule gives the same error too. The advice
require("image.png")
doesn't work either. Where should resources be placed, and how to reference them by relative path in kotlin/js react app? Please, help! Google gives only 2-year (and more) old advices which don't help, because kotlin/js seems to have changed much recently.
t
1. You need to add
src/main/resources/
in modules 2. You need add loader for
png
Webpack plugin can add resources to modules automatically https://github.com/turansky/kfc-plugins#resources