[Gradle, JS] Add resolution configuration method
^KT-41054 fixed
This commit is contained in:
+4
-8
@@ -1,5 +1,3 @@
|
||||
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnResolution
|
||||
|
||||
plugins {
|
||||
kotlin("js").version("<pluginMarkerVersion>")
|
||||
}
|
||||
@@ -14,12 +12,10 @@ repositories {
|
||||
|
||||
rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin::class.java) {
|
||||
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().apply {
|
||||
resolutions.add(
|
||||
YarnResolution("lodash").apply {
|
||||
include("^1.0.0")
|
||||
exclude("~1.2.1", "1.3.0 - 1.4.0")
|
||||
}
|
||||
)
|
||||
resolution("lodash") {
|
||||
include("^1.0.0")
|
||||
exclude("~1.2.1", "1.3.0 - 1.4.0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.yarn
|
||||
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.Incubating
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.TaskProvider
|
||||
@@ -45,6 +46,13 @@ open class YarnRootExtension(val project: Project) : ConfigurationPhaseAware<Yar
|
||||
|
||||
var resolutions: MutableList<YarnResolution> = mutableListOf()
|
||||
|
||||
fun resolution(path: String, configure: Action<YarnResolution>) {
|
||||
resolutions.add(
|
||||
YarnResolution(path)
|
||||
.apply { configure.execute(this) }
|
||||
)
|
||||
}
|
||||
|
||||
@Incubating
|
||||
fun disableGranularWorkspaces() {
|
||||
val packageJsonUmbrella = NodeJsRootPlugin.apply(project)
|
||||
|
||||
Reference in New Issue
Block a user