optionalNpm

abstract fun optionalNpm(name: String, version: String): Dependency

Deprecated

Deprecated in favor of npmOptional

Replace with

npmOptional(name, version) /* must not be passed to the implementation(...) or api(...) calls */

Deprecated - wrapping npm dependencies in implementation(optionalNpm(...)) is deprecated. Declare them with npmOptional instead, as a standalone statement:

kotlin.sourceSets["jsMain"].dependencies {
npmOptional("is-odd-even", "1.1.0")
}

Scheduled for removal in Kotlin 2.7.

Parameters

name

The NPM dependency name

version

The NPM dependency version


abstract fun optionalNpm(name: String, directory: File): Dependency

Deprecated

Deprecated in favor of npmOptional

Replace with

npmOptional(name, directory) /* must not be passed to the implementation(...) or api(...) calls */

Deprecated - wrapping npm dependencies in implementation(optionalNpm(...)) is deprecated. Declare them with npmOptional instead, as a standalone statement:

kotlin.sourceSets["jsMain"].dependencies {
npmOptional("is-odd-even", project.file("npm/is-odd-even"))
}

Scheduled for removal in Kotlin 2.7.

Parameters

name

The NPM dependency name

directory

The directory where dependency files are located (See NPM directory keyword)


abstract fun optionalNpm(directory: File): Dependency

Deprecated

Deprecated in favor of npmOptional

Replace with

npmOptional("dependency-name", directory) /* must not be passed to the implementation(...) or api(...) calls */

Deprecated - wrapping npm dependencies in implementation(optionalNpm(...)) is deprecated. Declare them with npmOptional instead, as a standalone statement with an explicit dependency name:

kotlin.sourceSets["jsMain"].dependencies {
npmOptional("is-odd-even", project.file("npm/is-odd-even"))
}

Scheduled for removal in Kotlin 2.7.

Parameters

directory

The directory where dependency files are located (See NPM directory keyword)