diff --git a/build.gradle.kts b/build.gradle.kts index 14c6f776845..d28633df48d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1136,3 +1136,13 @@ plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin: nodeVersion = "16.2.0" } } + +afterEvaluate { + val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true + if (cacheRedirectorEnabled) { + rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin::class.java) { + rootProject.the().downloadBaseUrl = + "https://cache-redirector.jetbrains.com/github.com/yarnpkg/yarn/releases/download" + } + } +} \ No newline at end of file