Skip to content

Commit

Permalink
Add network settings for kotlin npm install
Browse files Browse the repository at this point in the history
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

yarnpkg/yarn#2146
  • Loading branch information
ilgonmic committed Dec 8, 2021
1 parent 767c570 commit a91cfb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,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")
}
}

Expand Down

0 comments on commit a91cfb7

Please sign in to comment.