Ran
05/25/2022, 2:44 AMsourceSets {
val jsMain by getting {
dependencies {
implementation(npm("bignumber.js", "9.0.2"))
}
}
}
I published my KMP library to my private maven and use it in my another KMP project:
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.calculation.multiplatform:MultiplatformBigDecimal:1.0.0")
}
}
}
Then I build js package in my KMP project use ./gradlew jsBrowserProductionWebpack
command. The problem is that I cannot see peerDependencies on MultiplatformBigDecimal and bignumber.jsBig Chungus
05/25/2022, 7:20 AMBig Chungus
05/25/2022, 7:20 AMBig Chungus
05/25/2022, 7:21 AMRan
05/25/2022, 8:05 AMRan
05/25/2022, 9:31 AMRan
05/25/2022, 9:31 AMBig Chungus
05/25/2022, 10:18 AMBig Chungus
05/25/2022, 10:19 AMBig Chungus
05/25/2022, 10:20 AMBig Chungus
05/25/2022, 10:20 AMRan
05/25/2022, 10:34 AM{
"name": "test-abacus-bignumber",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"abacus": "^0.0.17-alpha.29212"
}
}
The abacus is a KMP project and the project will publish a js package.
In abacus project
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.calculation.multiplatform:MultiplatformBigDecimal:1.0.0")
}
}
}
MultiplatformBigDecimal is another KMP library.
In MultiplatformBigDecimal project
kotlin {
sourceSets {
val jsMain by getting {
dependencies {
implementation(npm("bignumber.js", "9.0.2"))
}
}
}
}
Now back to JS project, I'll encounter <cannot find module 'bignumber.js'>.Ran
05/25/2022, 10:36 AMBig Chungus
05/25/2022, 10:51 AMBig Chungus
05/25/2022, 10:53 AMRan
05/25/2022, 10:55 AM