If I add a file in `src/main/resources` , `maven-p...
# javascript
c
If I add a file in
src/main/resources
,
maven-publish
correctly adds it to the generated
.klib
, but it doesn't seem like a downstream project can access it, it is extracted in
/build/tmp/expandedArchives
but doesn't seem to be copied anywhere. Do you know how the downstream library can use it? I expected it to appear in
build/js/packages/<module>
since that's where Webpack executes.
d
The "safest" way I've found to deal with this is to create a new resources folder on your consumer (something like
build/copiedResources
) and then set up some copy tasks in your gradle config that run and copy those resources into that new resources directory then when you run any webpack tasks, those resources will automatically be copied into your build output
c
You mean that the downstream project should add these rules to their build.gradle?
(for anyone else seeing this, there is a matching task on YouTrack that has been inactive for a few years now)
d
Yes
r
There is currently no stable way to deal with resources contained inside published kotlin/js artifacts. I have been through many solutions for this problem with KVision. E.g. the extraction directory changed many times even with Kotlin minor releases. After months of struggling the final solution for my library was to put all resources into a single artifact published to NPM.