Say I have multiplatform projects, multiplatform-a
and multiplatform-b
. I’d like to use multiplatform-b
in a JavaScript project. When I run ./gradlew multiplatform-b:jsPublicPackageJson
, the resulting build/js/packages/multiplatform-b/package.json
looks like
{
"name": "multiplatform-b",
"version": "1.0.0",
"main": "kotlin/multiplatform-b.js",
"devDependencies": {},
"dependencies": {
"multiplatform-a": "1.0.0", // NOTE THIS LINE
"kotlin": "file:/{{repository_root}}/build/js/packages_imported/kotlin/1.4.31",
"kotlin-test-js-runner": "file:/{{repository_root}}/build/js/packages_imported/kotlin-test-js-runner/1.4.31",
"kotlin-test": "file:/{{repository_root}}/build/js/packages_imported/kotlin-test/1.4.31"
},
"peerDependencies": {},
"optionalDependencies": {},
"bundledDependencies": []
}
When I try to use this as a dependency, yarn rightfully complains that it can’t find a package called multiplatform-a
from NPM. Is there a way to get the Kotlin-generated package.json file to use an explicit local file path rather than a version?