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:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user