Hey all, on does anyone have a way to expose MPP s...
# compose-web
m
Hey all, on does anyone have a way to expose MPP shared image resources so they're accessible in the browser? Realize that xml and svgs don't work with
painterResource()
but image files do (if they're accessible). Working on a Compose MPP project that shares code and resources (mainly images) between Android, Desktop and web. I can't find a way to get webpack to include all the shared common files.
m
Thanks Aleksey! I have my own homebrew asset manager running but I was stuck on getting webpack to include common resources in the final processedResources directory. I ended up making this work by manually including the shared resources folders via sourceset in the jsApp build.gradle file but this feels hacky. Was hoping to find a more elegant solution.
The jsApp build.gradle file I'm using which references includes resources manually because
implementation(project(":shared"))
doesn't seem to automatically
Copy code
kotlin {
    js(IR) {
        browser()
        binaries.executable()
    }
    sourceSets {
        val jsMain by getting  {
            dependencies {
                implementation(project(":shared"))
            }
            resources.srcDir("../shared/src/commonMain/resources")
        }
    }
}