Alexey Artemiev
03/30/2021, 8:26 PMval x by css {
backgroundImage = require("src/main/resources/image.png")
}
gives an error
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.
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.andylamax
03/30/2021, 11:18 PMrequire("image.png")
archana 0623
03/31/2021, 9:02 AMAlexey Artemiev
03/31/2021, 5:40 PMModule 'image.png' not found
The image file resides both in resources
, and in sources near .kt file. Neither helps.andylamax
03/31/2021, 8:05 PMresources
it doesn't work near .kt
Alexey Artemiev
04/03/2021, 7:07 PMAlexey Artemiev
04/03/2021, 8:38 PMkotlin-styled
package attracts me with its type-safe approach and Kotlin DSL way,
but possibly I should start with simple CSS usage, and with learning webpack...
Before create-react-app handled all this magic smoothly. :)