Add network settings for kotlin npm install

Because there can be multiple installations of NPM dependencies via Yarn, we need to work correctly consider concurrency of Yarn
Because Yarn cache could face with problems during concurrent installation, need to limit network concurrency with only 1 instance and use mutex on network

https://github.com/yarnpkg/yarn/issues/2146
This commit is contained in:
Ilya Goncharov
2021-12-03 15:57:44 +03:00
committed by Space
parent 14b5b85ae4
commit a66aeaf382
+3
View File
@@ -1171,6 +1171,9 @@ if (disableVerificationTasks) {
plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class) {
extensions.configure(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension::class.java) {
nodeVersion = "16.13.0"
npmInstallTaskProvider?.configure {
args += listOf("--network-concurrency", "1", "--mutex", "network")
} ?: error("kotlinNpmInstall task should exist inside NodeJsRootExtension")
}
}